You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey everyone, I'm working through auth for router and using the router context to share the auth object with all the child components of an authenticated route. This is simple enough to set up, and there are plenty of example of how to do this.
Where I'm getting stuck is when dealing with session invalidation. e.g. user invalidates all sessions for their google login through the google settings page. I want to periodically validate the user session and if it's been invalidated, update the auth object and trigger a re-render of all components so I can handle it gracefully.
Is there a clean way to update a routerContext from inside a component? or a service worker? Or is routerContext not the correct approach here and I should rely on reactContext for this in stead?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone, I'm working through auth for router and using the router context to share the auth object with all the child components of an authenticated route. This is simple enough to set up, and there are plenty of example of how to do this.
Where I'm getting stuck is when dealing with session invalidation. e.g. user invalidates all sessions for their google login through the google settings page. I want to periodically validate the user session and if it's been invalidated, update the auth object and trigger a re-render of all components so I can handle it gracefully.
Is there a clean way to update a routerContext from inside a component? or a service worker? Or is routerContext not the correct approach here and I should rely on reactContext for this in stead?
Beta Was this translation helpful? Give feedback.
All reactions