Implemented the login method and tested successful login