File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import {
13
13
import { handleError } from "@/utils"
14
14
15
15
const isLoggedIn = ( ) => {
16
- return localStorage . getItem ( "access_token " ) !== null
16
+ return localStorage . getItem ( "is_authenticated " ) !== null
17
17
}
18
18
19
19
const useAuth = ( ) => {
@@ -45,7 +45,7 @@ const useAuth = () => {
45
45
const response = await LoginService . loginAccessToken ( {
46
46
formData : data ,
47
47
} )
48
- localStorage . setItem ( "access_token " , response . access_token )
48
+ localStorage . setItem ( "is_authenticated " , "true" )
49
49
}
50
50
51
51
const loginMutation = useMutation ( {
@@ -61,7 +61,7 @@ const useAuth = () => {
61
61
const logout = async ( ) => {
62
62
try {
63
63
await LoginService . logout ( ) ;
64
- localStorage . removeItem ( "access_token " ) ;
64
+ localStorage . removeItem ( "is_authenticated " ) ;
65
65
navigate ( { to : "/login" } ) ;
66
66
} catch ( error ) {
67
67
console . error ( "Logout failed:" , error ) ;
You can’t perform that action at this time.
0 commit comments