Closed aliassan closed 3 weeks ago
I have this error when i try to login with the backend locally.
do you have the same error ?
@aliassan
No, I have 401 Unauthorized error in the front-end and jwt-expired error in the back-end
The problem i have is because i'm not authenticated but i still have the token in the localstorage
And the old token is used for the next request.
So i recieve in the SIWE request : /api/auth/siwe
{
"success": true,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4MkZDMGQ4NGZBOUM2OTc0NTVjMkI5ZWE0MTZiYzAwYjkyOTNiZDZFIiwiaWF0IjoxNzIwODkxMzE3LCJleHAiOjE3MjA5Nzc3MTd9.ndC05KtXu3Nyfn5MU_6rvyyn9tWEnzobWdJwNxiTxy8"
}
But the token for authenticating the user fully is
Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoiMHg4MkZDMGQ4NGZBOUM2OTc0NTVjMkI5ZWE0MTZiYzAwYjkyOTNiZDZFIiwiaWF0IjoxNzIwODg3OTgwLCJleHAiOjE3MjA5NzQzODB9._Q4ZIbDRs3MMaw2R9eabFMMmynLQyN9SuUkLMztP0TQ
They are not simillar.
But authentication need to be fully refactor to fix this issue.
Description
Describe the bug The auth token doesn't update and returns an old expired token so you're unable to login.
To Reproduce Steps to reproduce the behavior:
backend/src/controllers/authController.ts
, ln 58expiresIn
value to '5s'APP_URL/login
without logging outExpected behavior It should reset the
authToken
and update to the new generated value