Our application should not be accessible when the user is not logged in. As such, if the user is not logged in, they should always be redirected to the login page.
You can check whether the user is logged in by the presence of a JWT token in a "token" cookie.
The backend will refuse to produce a 200 response on any other endpoint than the login endpoint unless the user is logged in (i.e. a valid JWT token is sent along with the request).
Our application should not be accessible when the user is not logged in. As such, if the user is not logged in, they should always be redirected to the login page.
You can check whether the user is logged in by the presence of a JWT token in a "token" cookie.
The backend will refuse to produce a 200 response on any other endpoint than the login endpoint unless the user is logged in (i.e. a valid JWT token is sent along with the request).