mirror of
https://github.com/hknsh/project-knedita.git
synced 2024-11-28 17:41:15 +00:00
Updated cookie name
This commit is contained in:
parent
af1cc94d8e
commit
81b0c05d68
3 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ async function userAuthController(req: Request, res: Response): Promise<void> {
|
|||
badRequest(res, result.message)
|
||||
} else {
|
||||
res
|
||||
.cookie('token', result.token, {
|
||||
.cookie('knedita_token', result.token, {
|
||||
httpOnly: true,
|
||||
secure: process.env.NODE_ENV === 'production',
|
||||
})
|
||||
|
|
|
@ -6,7 +6,7 @@ async function userLogoutController(
|
|||
): Promise<void> {
|
||||
// @ts-expect-error clearCookie interface does not exists in Response.
|
||||
return res
|
||||
.clearCookie('token')
|
||||
.clearCookie('knedita_token')
|
||||
.status(200)
|
||||
.json({ message: 'Successfully logged out' })
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ async function authenticated(
|
|||
next: NextFunction,
|
||||
): Promise<void> {
|
||||
try {
|
||||
const token = req.cookies.token
|
||||
const token = req.cookies.knedita_token
|
||||
|
||||
if (token === undefined) {
|
||||
unauthorized(res, 'Missing token')
|
||||
|
|
Loading…
Reference in a new issue