From 33e78c35da1285fae5f3914779209af6c29d987e Mon Sep 17 00:00:00 2001 From: Weijie Zhao Date: Wed, 21 May 2025 18:20:11 +0800 Subject: [PATCH] fix(auth): fix regex in JWT decoding causing login issues for Chinese/Japanese user names (#809) --- frontend/src/stores/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index 21ea84ea5..1aff7115b 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -284,8 +284,8 @@ export const useAuthStore = defineStore('auth', () => { try { const base64 = jwt .split('.')[1] - .replace('/-/g', '+') - .replace('/_/g', '/') + .replace(/-/g, '+') + .replace(/_/g, '/') const info = new UserModel(JSON.parse(atob(base64))) const ts = Math.round((new Date()).getTime() / MILLISECONDS_A_SECOND)