generated from muhtadeetaron/nextjs-template
feat(zustand): add zustand stores for exam, timer and auth
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
import BackgroundWrapper from "@/components/BackgroundWrapper";
|
||||
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
|
||||
import { useAuth } from "@/context/AuthContext";
|
||||
import { clearAuthToken } from "@/lib/auth";
|
||||
import { useAuthStore } from "@/stores/authStore";
|
||||
import {
|
||||
Bookmark,
|
||||
ChartColumn,
|
||||
@ -23,10 +23,10 @@ import React from "react";
|
||||
|
||||
const SettingsPage = () => {
|
||||
const router = useRouter();
|
||||
const { user, isLoading } = useAuth();
|
||||
const { user, logout } = useAuthStore();
|
||||
|
||||
function handleLogout() {
|
||||
clearAuthToken();
|
||||
logout();
|
||||
router.replace("/");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user