mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 17:45:23 +02:00
Add debug logging for session changes
This commit is contained in:
+9
-1
@@ -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>({
|
||||
|
||||
Reference in New Issue
Block a user