Upon Accessing a site, one might find that the Token set by logging in will be gone. This is due to an old function defined in the the file app/src/contexts/useAuthStore.ts called useToken(), that is called to define the token as const token = useToken();.
To remedy this issue, simply define the token as const token = localStorage.getItem("token");. This will get the token directly from the storage, and can be easily implemented across all pages.
Steps to Reproduce
Log in to the application with valid credentials. This sets an authentication token in the local storage
Access a route that uses the useToken() function, and the Token will be removed.
Expected Behavior
Upon accessing the affected route, the applications should simply allow the user to view the page.
Actual Behavior
Upon accessing the affected route, the user is effectively logged out, as they do not have a token anymore, and are redirected back to the Login page.
@Adachigaming You have not assigned anyone to this issue.
It may help get the attention of the team, if you assign members of the team in charge of web login.
Issue Description
Upon Accessing a site, one might find that the Token set by logging in will be gone. This is due to an old function defined in the the file
app/src/contexts/useAuthStore.ts
calleduseToken()
, that is called to define the token asconst token = useToken()
;.To remedy this issue, simply define the token as
const token = localStorage.getItem("token");
. This will get the token directly from the storage, and can be easily implemented across all pages.Steps to Reproduce
useToken()
function, and the Token will be removed.Expected Behavior
Upon accessing the affected route, the applications should simply allow the user to view the page.
Actual Behavior
Upon accessing the affected route, the user is effectively logged out, as they do not have a token anymore, and are redirected back to the Login page.
Additional Information