mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +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;
|
||||
try {
|
||||
details = await apiFetchDetails(fetch);
|
||||
} catch {
|
||||
throw redirect(302, '/register');
|
||||
} catch (e: any) {
|
||||
if (e.code === 401) {
|
||||
throw redirect(302, '/auth/login');
|
||||
} else {
|
||||
throw redirect(302, '/register');
|
||||
}
|
||||
}
|
||||
|
||||
let submissionProgress;
|
||||
|
|
|
|||
Loading…
Reference in a new issue