From 6b48ac3305573a59b4f27bce30b540fca6cedf08 Mon Sep 17 00:00:00 2001 From: Vova Stelmashchuk Date: Sun, 24 Nov 2024 21:53:36 +0200 Subject: [PATCH] fix admin session cookie expiration --- server/api/login.post.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server/api/login.post.js b/server/api/login.post.js index 9d512ae..461c8e8 100644 --- a/server/api/login.post.js +++ b/server/api/login.post.js @@ -5,8 +5,6 @@ export default defineEventHandler(async (event) => { const body = await readBody(event) const { username, password } = body - console.log('username:', username) - const { sessionId, expiresAt, error } = await addSessionToUser( username, password @@ -20,7 +18,7 @@ export default defineEventHandler(async (event) => { } if (sessionId && expiresAt) { - setCookie(event, 'sessionId', sessionId) + setCookie(event, 'sessionId', sessionId, { expires: new Date(expiresAt) }) return { status: 'success' }