Skip to content

Commit ef90453

Browse files
committed
Added auth page
1 parent 07a93d9 commit ef90453

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/routes/+layout.svelte

+7-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@
3030
3131
import { WEBUI_BASE_URL } from '$lib/constants';
3232
import i18n, { getLanguages, initI18n } from '$lib/i18n';
33-
33+
3434
const pathname = window.location.pathname;
3535
const isChat = pathname.startsWith('/chat');
36+
const isAuth = pathname.startsWith('/auth');
3637
3738
setContext('i18n', i18n);
3839
@@ -98,7 +99,11 @@
9899
USAGE_POOL.set(data['models']);
99100
});
100101
101-
if (isChat || localStorage.token) {
102+
if (isAuth) {
103+
localStorage.removeItem('token');
104+
localStorage.removeItem('isChat');
105+
await goto('/auth');
106+
} else if (isChat || localStorage.token) {
102107
let authToken;
103108
if (isChat) {
104109
console.log('isChat');

0 commit comments

Comments
 (0)