modified the login auth method