Skip to content

Page flashing before redirecting and getting the token to use with requests #333

Answered by kmjennison
Nikola-Milovic asked this question in Q&A
Discussion options

You must be logged in to vote
  1. You have a few options. One is to SSR, as you mentioned. Another is to set whenUnauthedBeforeInit to AuthAction.SHOW_LOADER, which will always show the loader component prior to Firebase initializing on the client. A third option is to let the page render but include conditional render logic in your page based on the AuthUser (e.g., show a blank page until the AuthUser is set).
  2. Yes, you should get the ID token every time so that it will refresh as needed. If you store the token value, you run the risk of it expiring.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Nikola-Milovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants