Clear cookie on 401
This commit is contained in:
parent
1b87214873
commit
b32cd53356
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue