Skip to content

Fix the logic of checking authentication

Grigor Malo requested to merge auth-logic-fix into master

Discriminate between "not yet authenticated" and "authentication failed" states

  • initialize currentUser as undefined
  • set currentUser to whatever the response is after the authentication query (object if successful auth, null if failed auth)
  • handle the two cases in RequireAuth component:
    • if currentUser is undefined return null and wait for authentication response
    • if currentUser is null redirect to login page

Merge request reports