fix(auth): update auth stack and remove token logging

Upgrade better-auth and @better-auth/passkey to 1.7.12 and hono to
4.13.13, which clears every auth-related advisory in pnpm audit. The
lockfile also picks up patched kysely, @simplewebauthn/server and defu.

Drop the Set-Cookie and cookie-name logging that exposed session tokens,
match ADMIN_EMAIL case-insensitively, revoke admin sessions when
ADMIN_PASSWORD_RESET rotates the password, and require user verification
for passkeys.
This commit is contained in:
Chris Scott committed 2026-10-21 11:00:15 -04:00
1 parent 959ed8ca2e
commit eb3937ef7e
11 files changed
+426 -258

No files matched your search

+1 -6
View File
@@ -16,7 +16,6 @@ export function createAuthMiddleware(
user: Session['user']
}
}>(async (c, next) => {
const cookies = c.req.header('cookie')
const origin = c.req.header('origin')
const fetchSite = c.req.header('sec-fetch-site')
@@ -30,11 +29,7 @@ export function createAuthMiddleware(
return c.json({ error: 'Cross-site request rejected' }, 403)
}
logger.debug(`Auth check - Path: ${c.req.path}, Origin: ${origin}, Has cookies: ${!!cookies}`)
if (cookies) {
const cookieNames = cookies.split(';').map(c => c.trim().split('=')[0]).join(', ')
logger.debug(`Cookie names: ${cookieNames}`)
}
logger.debug(`Auth check - Path: ${c.req.path}, Origin: ${origin}`)
let session
try {