feat: more redirects

This commit is contained in:
Sebastian Pravda 2022-12-03 19:37:39 +01:00 committed by EETagent
parent 0533ba9154
commit 415a8728c9

View file

@ -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;