login check
This commit is contained in:
parent
6a83355db1
commit
e44510110b
1 changed files with 10 additions and 0 deletions
10
revampdashboard/src/routes/dashboard/+page.server.ts
Normal file
10
revampdashboard/src/routes/dashboard/+page.server.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { redirect } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types';
|
||||
|
||||
export const load: PageServerLoad = ({ cookies }) => {
|
||||
const apiKey = String(cookies.get('apiKey') ?? '');
|
||||
|
||||
if (!apiKey) {
|
||||
return redirect(301, `${process.env.API_URL}/auth/new-login`);
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue