Skip to content

Commit

Permalink
fix admin session cookie expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
VovaStelmashchuk committed Nov 24, 2024
1 parent 9bf91aa commit 6b48ac3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions server/api/login.post.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
}
Expand Down

0 comments on commit 6b48ac3

Please sign in to comment.