mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac/fix: signout redirect flow
This commit is contained in:
@@ -347,6 +347,7 @@ export const userSignOut = async () => {
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
return res;
|
||||
};
|
||||
|
||||
export const addUser = async (
|
||||
|
||||
@@ -156,12 +156,11 @@
|
||||
<button
|
||||
class="flex rounded-md py-2 px-3 w-full hover:bg-gray-50 dark:hover:bg-gray-800 transition"
|
||||
on:click={async () => {
|
||||
await userSignOut();
|
||||
const res = await userSignOut();
|
||||
user.set(null);
|
||||
|
||||
localStorage.removeItem('token');
|
||||
location.href = '/auth';
|
||||
|
||||
location.href = res?.redirect_url ?? '/auth';
|
||||
show = false;
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -464,11 +464,11 @@
|
||||
}
|
||||
|
||||
if (now >= exp) {
|
||||
await userSignOut();
|
||||
const res = await userSignOut();
|
||||
user.set(null);
|
||||
|
||||
localStorage.removeItem('token');
|
||||
location.href = '/auth';
|
||||
|
||||
location.href = res?.redirect_url ?? '/auth';
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user