Showing
2 changed files
with
6 additions
and
5 deletions
... | @@ -39,8 +39,7 @@ export const signup = async (name, email, password) => { | ... | @@ -39,8 +39,7 @@ export const signup = async (name, email, password) => { |
39 | } | 39 | } |
40 | 40 | ||
41 | export const logout = async () => { | 41 | export const logout = async () => { |
42 | - 1 | 42 | + useSession.accessToken = undefined; |
43 | - useSession.accessToken = null; | ||
44 | return true; | 43 | return true; |
45 | } | 44 | } |
46 | 45 | ... | ... |
... | @@ -3,8 +3,10 @@ import { useRouter } from "next/router"; | ... | @@ -3,8 +3,10 @@ import { useRouter } from "next/router"; |
3 | 3 | ||
4 | 4 | ||
5 | export default function Logout () { | 5 | export default function Logout () { |
6 | - const router = useRouter(); | 6 | + const handleLogout = () => { |
7 | logout(); | 7 | logout(); |
8 | - router.push("/"); | 8 | + return <div>Logged out. Go to main page.</div> |
9 | - return <div>Logging out...</div>; | 9 | + } |
10 | + | ||
11 | + return handleLogout(); | ||
10 | } | 12 | } | ... | ... |
-
Please register or login to post a comment