瀏覽代碼

no more redirectToLogout on init error in dev and test envs

Olivier Massot 4 月之前
父節點
當前提交
6aa44bc4e8
共有 1 個文件被更改,包括 1 次插入1 次删除
  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