updated the authentication flow