251208:1625 Frontend: to be complete admin panel, Backend: tobe recheck all task
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-08 16:25:56 +07:00
parent dcd126d704
commit 863a727756
64 changed files with 5956 additions and 1256 deletions

View File

@@ -1,6 +1,6 @@
'use client';
import { useSession } from 'next-auth/react';
import { useSession, signOut } from 'next-auth/react';
import { useEffect } from 'react';
import { useAuthStore } from '@/lib/stores/auth-store';
@@ -9,7 +9,9 @@ export function AuthSync() {
const { setAuth, logout } = useAuthStore();
useEffect(() => {
if (status === 'authenticated' && session?.user) {
if (session?.error === 'RefreshAccessTokenError') {
signOut({ callbackUrl: '/login' });
} else if (status === 'authenticated' && session?.user) {
// Map NextAuth session to AuthStore user
// Assuming session.user has the fields we need based on types/next-auth.d.ts