about summary refs log tree commit diff
path: root/src/pages/Logout.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/Logout.tsx')
-rw-r--r--src/pages/Logout.tsx16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/pages/Logout.tsx b/src/pages/Logout.tsx
new file mode 100644
index 0000000..e480cb0
--- /dev/null
+++ b/src/pages/Logout.tsx
@@ -0,0 +1,16 @@
+import { useEffect } from 'react'
+import { useNavigate } from "react-router-dom";
+
+export default function Logout(props: any) {
+  const navigate = useNavigate();
+
+  useEffect(() => {
+    const logout = async () => {
+      await props.supabase.auth.signOut()
+    }
+    logout()
+    navigate('/login')
+  }, [props.session])
+
+  return (<></>)
+}