Add debug logging for session changes

This commit is contained in:
Christian Vidal Wolf
2026-04-10 08:24:58 +02:00
parent 1ef865250a
commit 935f3f02ec
+9 -1
View File
@@ -19,13 +19,21 @@ import { PendingValidationView } from './components/PendingValidationView';
export default function App() {
const [session, setSession] = useState<AuthSession | null>(() => getStoredSession());
useEffect(() => {
console.log('[App] session changed:', session ? 'logged in' : 'logged out');
}, [session]);
const handleSignOut = () => {
signOut();
setSession(null);
};
if (!session) {
return <LoginPage onLogin={() => setSession(getStoredSession())} />;
return <LoginPage onLogin={() => {
const stored = getStoredSession();
console.log('[App] onLogin, stored session:', stored ? 'found' : 'null');
setSession(stored);
}} />;
}
const [appState, setAppState] = useState<AppState>({