mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
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:
1 parent
959ed8ca2e
commit
eb3937ef7e
11 files changed
+426
-258
No files matched your search
@@ -69,7 +69,7 @@ export function createAuth(db: Database) {
|
||||
origin: ENV.AUTH.PASSKEY_ORIGIN,
|
||||
authenticatorSelection: {
|
||||
residentKey: 'required',
|
||||
userVerification: 'preferred',
|
||||
userVerification: 'required',
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user