fix: add device verification settings endpoints

This commit is contained in:
shuaiplus
2026-07-06 00:59:34 +08:00
parent 9de0d3bd87
commit e376a840c2
2 changed files with 75 additions and 0 deletions
+11
View File
@@ -19,6 +19,8 @@ import {
handlePutTwoFactorYubiKey,
handlePutTwoFactorYubiKeyConfig,
handleBootstrapTwoFactorYubiKeyConfig,
handleGetDeviceVerificationSettings,
handlePutDeviceVerificationSettings,
handleDisableTwoFactorProvider,
handleGetApiKey,
handleRotateApiKey,
@@ -153,6 +155,15 @@ export async function handleAuthenticatedRoute(
return handleGetTwoFactorYubiKey(request, env, userId);
}
if (path === '/api/two-factor/get-device-verification-settings' && method === 'POST') {
return handleGetDeviceVerificationSettings(request, env, userId);
}
if (path === '/api/two-factor/device-verification-settings') {
if (method === 'PUT' || method === 'POST') return handlePutDeviceVerificationSettings(request, env, userId);
return errorResponse('Method not allowed', 405);
}
if (path === '/api/two-factor/get-webauthn' && method === 'POST') {
return handleGetTwoFactorWebAuthn(request, env, userId, currentUser);
}