Monstarrrr / rebutify

Web platform where experts submit rebuttals to common arguments against social justice movements.
https://rebutify.org
5 stars 1 forks source link

Login user on startup if user has valid token #204

Closed Monstarrrr closed 1 week ago

Monstarrrr commented 1 week ago

Problem 1 - Auto login

We need to login the user on App load if he still has a valid token.

Problem 1.1 - SEO concerns

If the token is invalid or doesn't exist and we execute the API call to check its validity, then we get a 401 Unauthorized error which affects SEO.

Should we abort the API call if no valid token is found ?
More generally, should we interrupt any request requiring tokens if no valid token is found ?

I would say yes, as long as we still need to throw an error to let us know the API call wasn't triggered due to no stored token being found, but at least it won't be a 401 error AND we prevent using an API call unnecessarily.