fix(auth/refresh): send 403 res for invalid token to properly invalidate session (#1068)

This commit is contained in:
Danny Avila 2023-10-17 08:34:14 -04:00 committed by GitHub
parent 377f2c7c19
commit ddf56db316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View file

@ -112,7 +112,9 @@ const refreshController = async (req, res) => {
res.status(401).send('Refresh token expired or not found for this user');
}
} catch (err) {
res.status(401).send('Invalid refresh token');
console.error('Refresh token error', refreshToken);
console.error(err);
res.status(403).send('Invalid refresh token');
}
};