fix(auth): detect HTTPS via X-Forwarded-Proto for SameSite=None cookies, fix AuthGuard null overwrite

- Cookie SameSite now dynamic: None;Secure when behind HTTPS proxy, Lax otherwise
- AuthGuard useEffect no longer overwrites Zustand store with null from background refetch
- AuthInitializer: add staleTime 30s

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
MythEclipse
2026-06-15 18:17:26 +07:00
co-authored by Claude
parent 22307d44de
commit 51a4cb9ed2
4 changed files with 33 additions and 14 deletions
@@ -9,6 +9,7 @@ export function AuthInitializer() {
queryKey: ['auth', 'me'],
queryFn: () => apiClient.getMe(),
retry: false,
staleTime: 30_000,
});
useEffect(() => {