From e12a3edd9e0a1b9e56c240b434af793a213219ba Mon Sep 17 00:00:00 2001 From: Torsten Dittmann Date: Fri, 1 Mar 2024 13:30:33 +0100 Subject: [PATCH] fix: mfa type class --- app/controllers/api/account.php | 4 ++-- src/Appwrite/Auth/MFA/Challenge/Phone.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 198cb8508..3849c7fb4 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -3582,7 +3582,7 @@ App::post('/v1/account/mfa/:type') ->label('sdk.response.model', Response::MODEL_MFA_TYPE) ->label('sdk.offline.model', '/account') ->label('sdk.offline.key', 'current') - ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . TYPE::TOTP . '`') + ->param('type', null, new WhiteList([Type::TOTP]), 'Type of authenticator. Must be `' . Type::TOTP . '`') ->inject('requestTimestamp') ->inject('response') ->inject('project') @@ -3766,7 +3766,7 @@ App::post('/v1/account/mfa/challenge') ->label('sdk.response.model', Response::MODEL_MFA_CHALLENGE) ->label('abuse-limit', 10) ->label('abuse-key', 'url:{url},token:{param-token}') - ->param('factor', '', new WhiteList([Type::EMAIL, Type::PHONE, Type::TOTP]), 'Factor used for verification. Must be one of following: `' . TYPE::EMAIL . '`, `' . TYPE::PHONE . '`, `' . TYPE::TOTP . '`.') + ->param('factor', '', new WhiteList([Type::EMAIL, Type::PHONE, Type::TOTP]), 'Factor used for verification. Must be one of following: `' . Type::EMAIL . '`, `' . Type::PHONE . '`, `' . Type::TOTP . '`.') ->inject('response') ->inject('dbForProject') ->inject('user') diff --git a/src/Appwrite/Auth/MFA/Challenge/Phone.php b/src/Appwrite/Auth/MFA/Challenge/Phone.php index 24010fc2a..8304f97a9 100644 --- a/src/Appwrite/Auth/MFA/Challenge/Phone.php +++ b/src/Appwrite/Auth/MFA/Challenge/Phone.php @@ -3,6 +3,7 @@ namespace Appwrite\Auth\MFA\Challenge; use Appwrite\Auth\MFA\Challenge; +use Appwrite\Auth\MFA\Type; use Utopia\Database\Document; class Phone extends Challenge