From 2000732e350bd76f4f3b3da8919d09f23fb3875d Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 8 Apr 2026 10:57:53 +0200 Subject: [PATCH] fix: skip refreshUserInfo for link share tokens to prevent logout loop --- frontend/src/stores/auth.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index b2f77c391..94f568885 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -307,6 +307,7 @@ export const useAuthStore = defineStore('auth', () => { const jwt = getToken() let isAuthenticated = false + let jwtUserType: number | undefined if (jwt) { try { const base64 = jwt @@ -315,6 +316,7 @@ export const useAuthStore = defineStore('auth', () => { .replace(/_/g, '/') const payload = JSON.parse(atob(base64)) const jwtUser = new UserModel(payload) + jwtUserType = jwtUser.type const ts = Math.round((new Date()).getTime() / MILLISECONDS_A_SECOND) isAuthenticated = jwtUser.exp >= ts @@ -358,7 +360,7 @@ export const useAuthStore = defineStore('auth', () => { logout() } - if (isAuthenticated) { + if (isAuthenticated && jwtUserType !== AUTH_TYPES.LINK_SHARE) { const user = await refreshUserInfo() if (!user) { // refreshUserInfo() did not return a user — either the