Parcourir la source

no more redirectToLogout on init error in dev and test envs

Olivier Massot il y a 5 mois
Parent
commit
6aa44bc4e8
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      plugins/init.server.ts

+ 1 - 1
plugins/init.server.ts

@@ -46,7 +46,7 @@ export default defineNuxtPlugin(async () => {
   try {
     await initiateProfile(accessId, bearer.value ?? '', switchId)
   } catch (error) {
-    if (error instanceof UnauthorizedError) {
+    if (error instanceof UnauthorizedError && runtimeConfig.public.env === 'production') {
       redirectToLogout()
     } else {
       throw error