We need to login the user on App load if he still has a valid token.
[x] Call auth/users/me on App initialization
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.
[x] Abort API call if endpoint requires token and none has been found in storage (or it is expired).
[x] Throw an error instead (no valid token found to initiate the API call)
Problem 1 - Auto login
We need to login the user on App load if he still has a valid token.
auth/users/me
on App initializationProblem 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.