I created a login system with JWT refresh token. The code works well when logging in and so on, but the problem occurs when the JWT expires. I need to send a refresh token request to get a new JWT. The process succeeds, but the issue is that during the first page refresh, the user is not activated. On the second refresh, they become activated.
I don't know the reason, even though I ensured that the operations are not synchronized, so the request must complete before displaying the page after updating the cookies. However, what happens is the opposite, I think.