Add the login function.
Modify the addPost method.