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
{{ message }}
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.
I'm trying to understand what's possible and what isn't with the library in combination with SSR (nextjs).
Is it possible to get information about the subject (person who is logged in) at server-side (e.g. in getServerSideProps)? This would be useful to pass in props that are dependent on who's logged in, but also for authorization server-side. I'm aware that a stub is used server-side.
If it's not possible to know who's logged-in server-side, how do people pass in subject-specific props? Or do they always use the API routes in that case (with proper authentication and authorization on the API routes)?
Also a bit related: I'm seeing warnings related to rehydration when I conditionally render whether the user was logged in or not. It makes sense when you realize that server-side the authenticated check always fails, and client-side it passes after you log in. Then there is indeed a difference in what is rendered server-side versus client-side. Are those warnings to be expected then?
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
-
I'm trying to understand what's possible and what isn't with the library in combination with SSR (nextjs).
Is it possible to get information about the subject (person who is logged in) at server-side (e.g. in getServerSideProps)? This would be useful to pass in props that are dependent on who's logged in, but also for authorization server-side. I'm aware that a stub is used server-side.
If it's not possible to know who's logged-in server-side, how do people pass in subject-specific props? Or do they always use the API routes in that case (with proper authentication and authorization on the API routes)?
Also a bit related: I'm seeing warnings related to rehydration when I conditionally render whether the user was logged in or not. It makes sense when you realize that server-side the authenticated check always fails, and client-side it passes after you log in. Then there is indeed a difference in what is rendered server-side versus client-side. Are those warnings to be expected then?
Beta Was this translation helpful? Give feedback.
All reactions