chore(lint): add safe fallbacks for Nitro globals (getMethod/getRequestURL) in passkey and middleware handlers
This commit is contained in:
@@ -14,7 +14,7 @@ export default defineEventHandler(async (event) => {
|
||||
}
|
||||
|
||||
// Provide a safe fallback for getMethod when linting/runtime doesn't expose it
|
||||
const _getMethod = typeof getMethod === 'function' ? getMethod : (e) => (e?.req?.method || e?.method || 'GET')
|
||||
const _getMethod = typeof globalThis.getMethod === 'function' ? globalThis.getMethod : (e) => (e?.req?.method || e?.method || 'GET')
|
||||
if (_getMethod(event) === 'OPTIONS') {
|
||||
return { success: true }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user