Skip to content

Firebase authentication expired token issue #900

Closed Answered by ccssmnn
alexluong asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, I think the solution here is to use "the remix approach".

Firebase by default handles authentication, tokens and the like on the client. Usually you would handle sessions and cookies on the server. Which is why remix provides elegant tooling for this.

The approach is the following:

  1. In a login form, send email and password to the server
  2. In your action, call signInWithEmailAndPassword in your server. Yes, its the client-sdk we will use here.
  3. Still in your action, use the client-sdk to generate a JWT
  4. Still in your action, use the JWT to generate a firebase session cookie (a string) and store it as a value in the remix session cookie.
  5. Respond to the login request with the remix session …

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@ccssmnn
Comment options

@ccssmnn
Comment options

@alexluong
Comment options

@ccssmnn
Comment options

@Ehesp
Comment options

Answer selected by machour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants