Added the login function

Added the login function