Handling authorization expiration in client-side, without passing the refresh token to client? #11370
Replies: 2 comments
-
use https://kit.svelte.dev/docs/modules#$app-navigation-invalidate |
Beta Was this translation helpful? Give feedback.
-
Taking @CaptainCodeman's advice, I tried a lot of things with invalidation but could not get the behavior I wanted. Right now, the problem has evolved to this:
Invalidating in In order to handle that, I would need to implement a function in client side that would handle 401 responses. This is not optimal since load() functions not always return API responses. Calling invalidation functions in load context seems to be undefined behavior since I could not find any documentation about it or any examples. I think it should not matter, since Also, for some reason, if you invalidate in |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm currently handling authentication this way:
Everything works fine in server-side. However, if the access-token expires in client-side, I need to somehow force page reload so that backend server can refresh the token.
I don't want to rotate the token in client-side since I would have to pass-down the long-living refresh token to client, which is not optimal.
Notice at this point, I'm using universal
page.js
file withload()
function.A similar case, when I update the user object, how would I update the
data
(that was passed via layout) in client side?Beta Was this translation helpful? Give feedback.
All reactions