fix: route Account Pending sign out through backend signout flow (#25681)
The Sign Out button on the Account Pending overlay only cleared the local token and redirected to /auth, skipping the backend signout. This left the OAuth/OIDC session alive at the IdP, so re-login bounced the user straight back into pending and never re-fetched updated role/group claims. Call userSignOut() and honor the returned redirect_url, matching the sidebar logout flow. Fixes #25644 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
525c115a3a
commit
534206095f
1 file changed
+6
-2
@@ -2,7 +2,7 @@
|
|||||||
import DOMPurify from 'dompurify';
|
import DOMPurify from 'dompurify';
|
||||||
import { marked } from 'marked';
|
import { marked } from 'marked';
|
||||||
|
|
||||||
import { getAdminDetails } from '$lib/apis/auths';
|
import { getAdminDetails, userSignOut } from '$lib/apis/auths';
|
||||||
import { onMount, tick, getContext } from 'svelte';
|
import { onMount, tick, getContext } from 'svelte';
|
||||||
import { config } from '$lib/stores';
|
import { config } from '$lib/stores';
|
||||||
|
|
||||||
@@ -70,8 +70,12 @@
|
|||||||
<button
|
<button
|
||||||
class="text-xs text-center w-full mt-2 text-gray-400 underline"
|
class="text-xs text-center w-full mt-2 text-gray-400 underline"
|
||||||
on:click={async () => {
|
on:click={async () => {
|
||||||
|
const res = await userSignOut().catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
return null;
|
||||||
|
});
|
||||||
localStorage.removeItem('token');
|
localStorage.removeItem('token');
|
||||||
location.href = '/auth';
|
location.href = res?.redirect_url ?? '/auth';
|
||||||
}}>{$i18n.t('Sign Out')}</button
|
}}>{$i18n.t('Sign Out')}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user