mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-27 14:02:14 +00:00
feat: more redirects
This commit is contained in:
parent
0533ba9154
commit
415a8728c9
1 changed files with 6 additions and 2 deletions
|
|
@ -6,8 +6,12 @@ export const load: LayoutServerLoad = async ({ fetch }) => {
|
||||||
let details;
|
let details;
|
||||||
try {
|
try {
|
||||||
details = await apiFetchDetails(fetch);
|
details = await apiFetchDetails(fetch);
|
||||||
} catch {
|
} catch (e: any) {
|
||||||
throw redirect(302, '/register');
|
if (e.code === 401) {
|
||||||
|
throw redirect(302, '/auth/login');
|
||||||
|
} else {
|
||||||
|
throw redirect(302, '/register');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let submissionProgress;
|
let submissionProgress;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue