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:
co-authored by
Claude Opus 4.8
parent
525c115a3a
commit
534206095f
@@ -2,7 +2,7 @@
|
||||
import DOMPurify from 'dompurify';
|
||||
import { marked } from 'marked';
|
||||
|
||||
import { getAdminDetails } from '$lib/apis/auths';
|
||||
import { getAdminDetails, userSignOut } from '$lib/apis/auths';
|
||||
import { onMount, tick, getContext } from 'svelte';
|
||||
import { config } from '$lib/stores';
|
||||
|
||||
@@ -70,8 +70,12 @@
|
||||
<button
|
||||
class="text-xs text-center w-full mt-2 text-gray-400 underline"
|
||||
on:click={async () => {
|
||||
const res = await userSignOut().catch((err) => {
|
||||
console.error(err);
|
||||
return null;
|
||||
});
|
||||
localStorage.removeItem('token');
|
||||
location.href = '/auth';
|
||||
location.href = res?.redirect_url ?? '/auth';
|
||||
}}>{$i18n.t('Sign Out')}</button
|
||||
>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user