chore(lint): add safe fallbacks for Nitro globals (getMethod/getRequestURL) in passkey and middleware handlers
This commit is contained in:
@@ -5,6 +5,9 @@ import { getWebAuthnConfig } from '../../utils/webauthn-config.js'
|
||||
import { setPreRegistration } from '../../utils/webauthn-challenges.js'
|
||||
import { writeAuditLog } from '../../utils/audit-log.js'
|
||||
|
||||
// Local fallback for Nitro globals when lint/run env doesn't provide them
|
||||
const getMethod = globalThis.getMethod ?? ((e) => (e?.req?.method || e?.method || 'GET'))
|
||||
|
||||
function isValidEmail(email) {
|
||||
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(email || ''))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user