aboutsummaryrefslogtreecommitdiff
path: root/web/src/app/components/sign-out.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/app/components/sign-out.jsx')
-rw-r--r--web/src/app/components/sign-out.jsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/web/src/app/components/sign-out.jsx b/web/src/app/components/sign-out.jsx
index dd6693d..b0762d8 100644
--- a/web/src/app/components/sign-out.jsx
+++ b/web/src/app/components/sign-out.jsx
@@ -1,5 +1,16 @@
+'use client';
+import { useAuth } from '@/context/middleware';
+
export default function SignOut() {
+ const { logout } = useAuth();
+
return (
- <button type="submit" className="py-2 px-4 rounded-md text-md bg-red-700 hover:bg-red-500">Sign out</button>
- )
+ <button
+ type="button"
+ onClick={logout}
+ className="py-2 px-4 rounded-md text-md bg-red-700 hover:bg-red-500"
+ >
+ Sign out
+ </button>
+ );
}