mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
feat: redirect to dashboard if logged in
This commit is contained in:
parent
0df661ab74
commit
dc9c6281b8
1 changed files with 11 additions and 0 deletions
11
frontend/src/routes/(candidate)/auth/login/+layout.server.ts
Normal file
11
frontend/src/routes/(candidate)/auth/login/+layout.server.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import type { LayoutServerLoad } from './$types';
|
||||
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutServerLoad = ({ cookies }) => {
|
||||
const isAuthenticated = cookies.get('id');
|
||||
|
||||
if (isAuthenticated) {
|
||||
throw redirect(302, '/dashboard');
|
||||
}
|
||||
};
|
||||
Loading…
Reference in a new issue