From df9bc6df56452798a486a132e0684ebfb5f5d8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Fri, 19 Jan 2024 13:42:26 +0000 Subject: [PATCH] Implement OTP email endpoint + tests --- app/config/auth.php | 7 + app/config/locale/templates/email-base.tpl | 1 + app/config/locale/templates/email-otp.tpl | 14 +- app/config/locale/translations/en.json | 3 +- app/controllers/api/account.php | 231 ++++++++++++++++++++- src/Appwrite/Auth/Auth.php | 3 +- tests/e2e/Services/Account/AccountBase.php | 100 +++++++++ 7 files changed, 354 insertions(+), 5 deletions(-) diff --git a/app/config/auth.php b/app/config/auth.php index ca62256dc2..930df226e1 100644 --- a/app/config/auth.php +++ b/app/config/auth.php @@ -17,6 +17,13 @@ return [ 'docs' => 'https://appwrite.io/docs/references/cloud/client-web/account#accountCreateMagicURLToken', 'enabled' => true, ], + 'email' => [ + 'name' => 'Email (OTP)', + 'key' => 'email', + 'icon' => '/images/users/email.png', + 'docs' => 'https://appwrite.io/docs/references/cloud/client-web/account#accountCreateEmailToken', + 'enabled' => true, + ], 'anonymous' => [ 'name' => 'Anonymous', 'key' => 'anonymous', diff --git a/app/config/locale/templates/email-base.tpl b/app/config/locale/templates/email-base.tpl index 346f2f1589..8c571c2b56 100644 --- a/app/config/locale/templates/email-base.tpl +++ b/app/config/locale/templates/email-base.tpl @@ -10,6 +10,7 @@