From cb6d514d4c29f3618b55d58bc4e26bec943ba9be Mon Sep 17 00:00:00 2001 From: huydo862003 Date: Mon, 18 Dec 2023 17:19:35 +0700 Subject: [PATCH] fix: clear tokenCookie upon entering login api --- src/handlers/auth.handler.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/handlers/auth.handler.ts b/src/handlers/auth.handler.ts index 9bc8828..6d4d8f1 100644 --- a/src/handlers/auth.handler.ts +++ b/src/handlers/auth.handler.ts @@ -12,6 +12,8 @@ import { Handler } from '@interfaces'; import { logger } from '@utils'; const login: Handler = async (req, res) => { + res.clearCookie('token'); + const user = await prisma.user.findUnique({ select: { id: true,