security improvements

This commit is contained in:
2025-10-07 13:39:53 -04:00
parent a4aca9c99d
commit 329becfb08
11 changed files with 287 additions and 35 deletions

View File

@@ -1,6 +1,16 @@
import { clearAuthCookie } from '~/server/utils/auth'
import { clearAuthCookie, getAuthCookie } from '~/server/utils/auth'
import { deleteSession } from '~/server/utils/database'
export default defineEventHandler(async (event) => {
// Get session token from cookie
const sessionToken = getAuthCookie(event)
// Delete session from database if it exists
if (sessionToken) {
deleteSession(sessionToken)
}
// Clear the cookie
clearAuthCookie(event)
return {