Replies: 1 comment 3 replies
-
Once you know who's the user (the verify function is called) what you do with the params is outside the scope of Remix Auth, so if you decide you need or not the access token it's up to you. This means, refreshing it is also responsibility of the app. That said, one thing you can do is to create a wrapper of the isAuthenticated method, get the access token and expiration date, if it's expired refresh it and redirect to the same URL while setting the session cookie to have the new token and expiration date, that will trigger the loader again and this time it will have a non expired token and continue the normal flow. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just wondering if theres a simple way of doing this?
I can't see any simple method without storing an
expires_in
in the object returned from theverify
function,Then in every loader/action checking to see if we have expired, refreshing the tokens, overwriting the session, and returning the new
Set-Cookie
header.It would be nice if we could just
invalidate
the return ofverify
function, causing it to use somerefresh
method, and hence updating the return object for every consumer.Beta Was this translation helpful? Give feedback.
All reactions