Browse Source

redirect to login on invalid access id

Olivier Massot 1 year ago
parent
commit
35ab71e590
1 changed files with 2 additions and 1 deletions
  1. 2 1
      plugins/init.server.ts

+ 2 - 1
plugins/init.server.ts

@@ -17,7 +17,8 @@ export default defineNuxtPlugin(async () => {
 
     const accessId: number = parseInt(accessCookieId.value)
     if (isNaN(accessId)) {
-        throw new Error('Invalid access id')
+        redirectToLogout()
+        return
     }
 
     const { initiateProfile } = useRefreshProfile()