Conversation
a45bea7 to
c1680b6
Compare
c331ea6 to
441e224
Compare
9a4e45c to
bdafc04
Compare
6d98c48 to
6b39967
Compare
bdafc04 to
5af80fe
Compare
6b39967 to
6779097
Compare
64b0b36 to
13bf542
Compare
| }; | ||
|
|
||
| return ( | ||
| <FullPageDialog> |
There was a problem hiding this comment.
Really struggled to hide the avatar in the upper right - my understanding is that setUserDetails(null) should do it, but I think the authStateChange listener defined in User/index.tsx was restoring that value.
So anyway, I'm punting on that and using this FullPageDialog wrapper component that omits the top bar entirely. Let me know what you think.
There was a problem hiding this comment.
Yup - this is fine and what I expected the faster solution to be :D
| // Remove the session directly from localStorage. | ||
| // We can't use supabaseClient.auth.signOut() here | ||
| // because the token refresh that triggered this | ||
| // interceptor holds Supabase's internal session | ||
| // lock, so calling signOut deadlocks and hangs. | ||
| localStorage.removeItem(supabaseStorageKey); |
There was a problem hiding this comment.
some more weirdness - need to remove the session from local storage to prevent retrying the token refresh request. Normally we'd do that with supabaseClient.auth.signOut(), but calling that in this function hangs, i think because supabase already has a lock on the session during the refresh cycle (which we are interrupting here).
another option would be to call signOut() in a useEffect in the SsoRequired component. I kinda like having the logic centralized here, though.
There was a problem hiding this comment.
talked to travis - moving this to the SsoRequired useEffect and calling the actual signout() function
0e293c0 to
9f268b1
Compare
travjenkins
left a comment
There was a problem hiding this comment.
lgtm - we'll wanna keep an eye on 401 GQL calls but doubt that'll be an issue in prod
Summary
sso_required:<domain>errors from Supabase auth to redirect users to their organization's SSO providersso-requirederrorsFullPageSSONotSatisfied) that explains SSO is required and provides a one-click redirect to the tenant's identity provider viasignInWithSSO({ domain })Test plan
sso_requirederror on OAuth login → interstitial appears, SSO redirect workssso_requirederror on token refresh → interstitial appears