We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fb021d commit 65c576fCopy full SHA for 65c576f
demos/react-supabase-todolist/src/app/router.tsx
@@ -28,6 +28,14 @@ const AuthGuard = ({ children }: AuthGuardProps) => {
28
console.error(`No Supabase connector has been created yet.`);
29
return;
30
}
31
+
32
+ connector.client.auth.onAuthStateChange(async (event, _session) => {
33
+ if (event === 'SIGNED_OUT') {
34
+ console.log("here");
35
+ navigate(LOGIN_ROUTE);
36
+ }
37
+ });
38
39
const loginGuard = () => {
40
if (!connector.currentSession) {
41
navigate(LOGIN_ROUTE);
0 commit comments