Prehook & pass data to handleDataRequest
to auto set-cookie for refreshed session.
#3377
WesleyKapow
started this conversation in
Proposals
Replies: 2 comments
-
Oh and if we did have a prehook that could validate the session and possibly refresh the token for us. It'd be good if the prehook can mutate the |
Beta Was this translation helpful? Give feedback.
0 replies
-
There's a Draft PR submitted by @jacob-ebey adding I think it's on hold at the moment. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is related to #2166 and sergiodxa/remix-auth#147.
The basic idea is that we need to return the
Set-Cookie
header with a new session whenever an auth token is refreshed (via a refresh token). The current best solution is to either do this outside of remix (express, if you are using it) OR have all of your loaders & actions do something like:NOTE: Loaders can avoid dealing with
headers
themselves as we can do athrow redirect(request.url, {headers}
withinauthenticateSession
.The two sad parts here are:
Number 1 above can be handled via some type of prehook that I believe is being discussed (I can't find any GH discussion on it).
Number 2 above could be resolved if there was someway for
authenticateSession
to setup something thathandleDataRequest
can read, allowinghandleDataRequest
to always return the possibly updatedheaders
.Beta Was this translation helpful? Give feedback.
All reactions