feat: add notes app

This commit is contained in:
2026-10-01 19:39:20 +02:00
parent ccb8dd3d15
commit ddbb6f37b5
35 changed files with 706 additions and 52 deletions
@@ -1,14 +0,0 @@
const FAILED_LOGIN_DELAY_MS = 1000
export default defineEventHandler(async (event) => {
const { password } = await readValidBody(event, loginSchema)
if (!(await passwordMatches(event, password))) {
await new Promise(resolve => setTimeout(resolve, FAILED_LOGIN_DELAY_MS))
throw createError({ statusCode: 401, statusMessage: 'Wrong password' })
}
const session = await diarySession(event)
await session.update({ unlocked: true })
return { unlocked: true }
})
@@ -1,4 +0,0 @@
export default defineEventHandler(async (event) => {
const session = await diarySession(event)
return { unlocked: !!session.data.unlocked }
})