Updated authentication flow.