diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 5c5676f653..93bb27a08c 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -4545,7 +4545,9 @@ App::put('/v1/account/mfa/challenge/webauthn') ])); // Update Session - $dbForProject->deleteDocument('challenges', $challengeId); + Authorization::skip(function () use ($dbForProject, $challengeId) { + $dbForProject->deleteDocument('challenges', $challengeId); + }); $dbForProject->purgeCachedDocument('users', $user->getId()); $factors = $session->getAttribute('factors', []); @@ -4558,9 +4560,6 @@ App::put('/v1/account/mfa/challenge/webauthn') $dbForProject->updateDocument('sessions', $session->getId(), $session); - // Delete challenge - $dbForProject->deleteDocument('challenges', $challengeId); - $queueForEvents ->setParam('userId', $user->getId()) ->setParam('sessionId', $session->getId()); diff --git a/src/Appwrite/Auth/MFA/Type/WebAuthn.php b/src/Appwrite/Auth/MFA/Type/WebAuthn.php index 255775c41d..a24ef82498 100644 --- a/src/Appwrite/Auth/MFA/Type/WebAuthn.php +++ b/src/Appwrite/Auth/MFA/Type/WebAuthn.php @@ -110,7 +110,12 @@ class WebAuthn extends Type // Console if ($project->getId() === 'console') { $platformName = 'Appwrite'; - $platformId = App::getEnv('_APP_DOMAIN', ''); + + if (App::isDevelopment()) { + $platformId = 'localhost'; + } else { + $platformId = App::getEnv('_APP_DOMAIN', ''); + } } return new PublicKeyCredentialRpEntity(