Fix the logic of checking authentication
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
- if currentUser is