Clear cookie on 401

This commit is contained in:
Ondřej Nývlt 2022-12-22 20:42:23 +01:00
parent 1b87214873
commit b32cd53356

View file

@ -21,6 +21,7 @@ export const verifyUser: RequestHandler = async (req, res, next) => {
next()
} catch (error) {
if (error instanceof HttpError && error.status === 401) {
res.clearCookie("token")
res.redirect("/login")
return
}