Skip to content

Commit

Permalink
Deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronnie5562 committed Aug 2, 2024
1 parent c0ff132 commit a986c6c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions docnet_frontend/src/services/AuthServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,18 @@ export function useAuthService(): AuthServiceProps {
`${BASE_URL}/users/token/`, {
email,
password,
}, { withCredentials: true }
}, { withCredentials: true }
);

const user_id = response.data.user_id
localStorage.setItem("user_id", user_id)

localStorage.setItem("isLoggedIn", "true")
setIsLoggedIn(true)

getUserDetails()

// I used setTimeout to delay the navigation to the profile page
// So that the data I need to store in localstorage is available
setTimeout(() => navigate("/"), 1000)
localStorage.setItem("isLoggedIn", "true")
setIsLoggedIn(true)
getUserDetails()
} catch (err: any) {
return err.response.status;
}
Expand Down

0 comments on commit a986c6c

Please sign in to comment.