security improvements
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { getAuthCookie, clearAuthCookie } from '~/server/utils/auth'
|
||||
import { getSessionUsername, clearAuthCookie } from '~/server/utils/auth'
|
||||
import { getUserByUsername } from '~/server/utils/database'
|
||||
|
||||
export default defineEventHandler(async (event) => {
|
||||
const username = getAuthCookie(event)
|
||||
const username = await getSessionUsername(event)
|
||||
|
||||
if (!username) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user