Skip to content

Login redirect complicates Firebase integration #785

@dimitrovs

Description

@dimitrovs

This issue is related to #514 , just a more complex scenario:

  1. Single Page App with Firebase & Auth0 integration (only authenticated mode)
  2. On load the app makes request to protected Firebase endpoint and catches authentication exception:
  • More reliable than dealing with token expiry / local storage, if Firebase says we need to authenticate then we need to authenticate, no matter the underlying cause.
  1. Firebase authentication exception triggers Auth0 Lock window display.
  2. User provides credentials.
  3. Auth0 performs authentication and redirects back to app.
  4. Firebase request goes out before the Auth0 token has been exchanged with Firebase and this triggers the Auth0 Lock window to display again.

Basically the problem is that the Single Page App doesn't know when Auth0 is about to redirect the user or that a page load was the result of a redirect. The "authenticated" and "hash_parsed" events are not enough if there is another asynchronous event involved (Firebase auth attempt in this case). The only workaround currently is: { auth: { redirect: false }, autoclose: true }

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions