[优化] 更新认证机制,使用 OPENFLARE_TOKEN 替代 Bearer Token

This commit is contained in:
ryan
2026-06-04 11:10:06 +08:00
parent bdc96f6d8e
commit 6aa71a4da8
38 changed files with 462 additions and 387 deletions
@@ -14,6 +14,7 @@ import {
logout as logoutRequest,
getCurrentUser,
} from '@/features/auth/api/auth';
import { clearStoredOpenFlareToken } from '@/lib/api/auth-token';
import type { AuthUser } from '@/types/auth';
interface AuthContextValue {
@@ -41,6 +42,7 @@ export function AuthProvider({ children }: AuthProviderProps) {
setUserState(nextUser);
return nextUser;
} catch {
clearStoredOpenFlareToken();
setUserState(null);
return null;
} finally {