Skip to content

Token revalidation #30

Closed Answered by sergiodxa
luishdz1010 asked this question in Q&A
Aug 14, 2022 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

Token revalidation is out of the scope of Remix Auth and this strategy in particular.

There are multiple ways you could support this:

  1. Keep the access and refresh tokens and the expiration date in a database, then run a background job to refresh all expired or near to expire tokens.
  2. Keep the same data on the session, then wrap the authenticator.isAuthenticated function to check for that, I wrote about this approach here https://sergiodxa.com/articles/working-with-refresh-tokens-in-remix.

There's probably more things you could do but I think those are the simplest ones.

As a side note, remember you may not need the access token, you only need it if you plan to use the provider API as the …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@bk-jb
Comment options

@sergiodxa
Comment options

@bk-jb
Comment options

@luishdz1010
Comment options

@bk-jb
Comment options

Answer selected by luishdz1010
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