mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 19:25:25 +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() {
|
export default function App() {
|
||||||
const [session, setSession] = useState<AuthSession | null>(() => getStoredSession());
|
const [session, setSession] = useState<AuthSession | null>(() => getStoredSession());
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log('[App] session changed:', session ? 'logged in' : 'logged out');
|
||||||
|
}, [session]);
|
||||||
|
|
||||||
const handleSignOut = () => {
|
const handleSignOut = () => {
|
||||||
signOut();
|
signOut();
|
||||||
setSession(null);
|
setSession(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!session) {
|
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>({
|
const [appState, setAppState] = useState<AppState>({
|
||||||
|
|||||||
Reference in New Issue
Block a user