fix: getLogStores Property and Handle 401 Error from Refresh Token Request (#1084)

* fix(getLogStores): correct wrong prop passed to keyv opts: duration -> ttl

* fix: edge case where we get a blank screen if the initially intercepted 401 error is from a refresh token request; in this case, make explicit to the server that we are retrying from a refreshToken request
This commit is contained in:
Danny Avila 2023-10-21 12:39:08 -04:00 committed by GitHub
parent abbc57a49a
commit 6cb561abcf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 27 deletions

View file

@ -106,6 +106,9 @@ const refreshController = async (req, res) => {
const token = await setAuthTokens(userId, res, session._id);
const userObj = user.toJSON();
res.status(200).send({ token, user: userObj });
} else if (req?.query?.retry) {
// Retrying from a refresh token request that failed (401)
res.status(403).send('No session found');
} else if (payload.exp < Date.now() / 1000) {
res.status(403).redirect('/login');
} else {