mirror of
https://github.com/wireadmin/wireadmin
synced 2025-02-26 05:48:44 +00:00
update
This commit is contained in:
parent
3e6575df6d
commit
58e2904a2c
@ -13,21 +13,15 @@ export const handle: Handle = async ({ event, resolve }) => {
|
||||
const is_login_page = event.url.pathname === '/login';
|
||||
|
||||
if (!token_valid && !is_login_page) {
|
||||
console.log('handle', event.url.pathname, 'invalid token');
|
||||
return redirect;
|
||||
}
|
||||
|
||||
if (token_valid && is_login_page) {
|
||||
console.log('handle', 'already logged in');
|
||||
return new Response(null, { status: 302, headers: { location: '/' } });
|
||||
}
|
||||
}
|
||||
|
||||
const resp = await resolve(event);
|
||||
|
||||
console.log('handle', event.url.pathname, resp.status);
|
||||
|
||||
return resp;
|
||||
return resolve(event);
|
||||
};
|
||||
|
||||
const AUTH_EXCEPTION = ['/api/health'];
|
||||
|
@ -34,7 +34,6 @@
|
||||
console.error('conf is null');
|
||||
return;
|
||||
}
|
||||
console.log('conf', conf);
|
||||
// create a blob
|
||||
const blob = new Blob([ conf ], { type: 'text/plain' });
|
||||
// create a link
|
||||
|
Loading…
Reference in New Issue
Block a user