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';
|
const is_login_page = event.url.pathname === '/login';
|
||||||
|
|
||||||
if (!token_valid && !is_login_page) {
|
if (!token_valid && !is_login_page) {
|
||||||
console.log('handle', event.url.pathname, 'invalid token');
|
|
||||||
return redirect;
|
return redirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token_valid && is_login_page) {
|
if (token_valid && is_login_page) {
|
||||||
console.log('handle', 'already logged in');
|
|
||||||
return new Response(null, { status: 302, headers: { location: '/' } });
|
return new Response(null, { status: 302, headers: { location: '/' } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const resp = await resolve(event);
|
return resolve(event);
|
||||||
|
|
||||||
console.log('handle', event.url.pathname, resp.status);
|
|
||||||
|
|
||||||
return resp;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const AUTH_EXCEPTION = ['/api/health'];
|
const AUTH_EXCEPTION = ['/api/health'];
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
console.error('conf is null');
|
console.error('conf is null');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('conf', conf);
|
|
||||||
// create a blob
|
// create a blob
|
||||||
const blob = new Blob([ conf ], { type: 'text/plain' });
|
const blob = new Blob([ conf ], { type: 'text/plain' });
|
||||||
// create a link
|
// create a link
|
||||||
|
Loading…
Reference in New Issue
Block a user