mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-01-31 15:37:09 +01:00
better server side signin redirects
this makes it so if a user requests a page (not API route) and isn't signed in, it automatically redirects them to the sign in page (doesn't show a flash of the error page)
This commit is contained in:
10
error.vue
10
error.vue
@@ -18,15 +18,7 @@ useHead({
|
||||
title: `${props.error?.statusCode ?? "An unknown error occurred"} | Drop`,
|
||||
});
|
||||
|
||||
const errorCode = props.error?.statusCode;
|
||||
if (errorCode != undefined) {
|
||||
switch (errorCode) {
|
||||
case 403:
|
||||
case 401:
|
||||
if (!user.value) signIn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
console.log(props.error);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user