From 75d3b2c08312620b0cc7f5110681f371077d0ca5 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 00:02:17 +0700 Subject: [PATCH 01/28] add class property $resendCodeVerification --- src/Config/Auth.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Config/Auth.php b/src/Config/Auth.php index 194631726..194caaaef 100644 --- a/src/Config/Auth.php +++ b/src/Config/Auth.php @@ -187,6 +187,15 @@ class Auth extends BaseConfig */ public int $magicLinkLifetime = HOUR; + /** + * -------------------------------------------------------------------- + * Resend Code Verification Time for re-new the code and send it again + * -------------------------------------------------------------------- + * Specify in integer how many seconds of delay time you want to + * re-new the code and send it from email. The default is 60 seconds. + */ + public int $resendCodeVerification = 60; + /** * -------------------------------------------------------------------- * Session Authenticator Configuration From 4e031c965f60bb5424419a599a69aecff515b437 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 00:10:09 +0700 Subject: [PATCH 02/28] update: sending email verification every 60 seconds --- src/Authentication/Actions/EmailActivator.php | 72 ++++++++++++------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/src/Authentication/Actions/EmailActivator.php b/src/Authentication/Actions/EmailActivator.php index 2b47f374e..43c931c37 100644 --- a/src/Authentication/Actions/EmailActivator.php +++ b/src/Authentication/Actions/EmailActivator.php @@ -54,36 +54,54 @@ public function show(): string ); } - $code = $this->createIdentity($user); - - /** @var IncomingRequest $request */ - $request = service('request'); - - $ipAddress = $request->getIPAddress(); - $userAgent = (string) $request->getUserAgent(); - $date = Time::now()->toDateTimeString(); - - // Send the email - helper('email'); - $email = emailer(['mailType' => 'html']) - ->setFrom(setting('Email.fromEmail'), setting('Email.fromName') ?? ''); - $email->setTo($userEmail); - $email->setSubject(lang('Auth.emailActivateSubject')); - $email->setMessage($this->view( - setting('Auth.views')['action_email_activate_email'], - ['code' => $code, 'user' => $user, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date], - ['debug' => false] - )); - - if ($email->send(false) === false) { - throw new RuntimeException('Cannot send email for user: ' . $user->email . "\n" . $email->printDebugger(['headers'])); + $userIdentities = $user->identities; + $userIdentity = array_pop($userIdentities); + + $now = new Time('now'); + $identityCreated = Time::parse($userIdentity->created_at); + + $timDiff = $identityCreated->difference($now); + + $resendCodeVerificationTime = (setting('Auth.resendCodeVerification') - $timDiff->getSeconds()); + + if ($timDiff->getSeconds() >= setting('Auth.resendCodeVerification') || $userIdentity->secret2 === null) { + $code = $this->createIdentity($user); + + /** @var IncomingRequest $request */ + $request = service('request'); + + $ipAddress = $request->getIPAddress(); + $userAgent = (string) $request->getUserAgent(); + $date = Time::now()->toDateTimeString(); + + // Send the email + helper('email'); + $email = emailer(['mailType' => 'html']) + ->setFrom(setting('Email.fromEmail'), setting('Email.fromName') ?? ''); + $email->setTo($userEmail); + $email->setSubject(lang('Auth.emailActivateSubject')); + $email->setMessage($this->view( + setting('Auth.views')['action_email_activate_email'], + ['code' => $code, 'user' => $user, 'ipAddress' => $ipAddress, 'userAgent' => $userAgent, 'date' => $date], + ['debug' => false] + )); + + if ($email->send(false) === false) { + throw new RuntimeException('Cannot send email for user: ' . $user->email . "\n" . $email->printDebugger(['headers'])); + } + + // Add flag + model(UserIdentityModel::class) + ->where('secret', $code) + ->set(['secret2' => 'SEND']) + ->update(); + + // Clear the email + $email->clear(); } - // Clear the email - $email->clear(); - // Display the info page - return $this->view(setting('Auth.views')['action_email_activate_show'], ['user' => $user]); + return $this->view(setting('Auth.views')['action_email_activate_show'], ['user' => $user, 'remainingTime' => $resendCodeVerificationTime]); } /** From 79eff58f155504bd6873001953900388dfe807f0 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 00:14:20 +0700 Subject: [PATCH 03/28] add remaining time info --- src/Views/email_activate_show.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Views/email_activate_show.php b/src/Views/email_activate_show.php index 6b41d4626..11f47ee1e 100644 --- a/src/Views/email_activate_show.php +++ b/src/Views/email_activate_show.php @@ -29,6 +29,8 @@ +

+ From 58d2f2da180702a50a796805a91a5001989a264d Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 00:18:30 +0700 Subject: [PATCH 04/28] add translation for remainingTime --- src/Language/id/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/id/Auth.php b/src/Language/id/Auth.php index 6910a81fd..a0e40a4ec 100644 --- a/src/Language/id/Auth.php +++ b/src/Language/id/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kode tidak sesuai.', 'needActivate' => 'Anda harus menyelesaikan registrasi Anda dengan mengonfirmasi kode yang dikirim ke alamat email Anda.', 'activationBlocked' => 'Anda harus mengaktifkan akun Anda sebelum masuk.', + 'remainingTime' => 'Anda dapat menerima kode baru dalam {0, number} detik lagi.', // Groups 'unknownGroup' => '{0} bukan grup yang sah.', From de2ce69556539e358bea910dc50726923b97126c Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 00:20:18 +0700 Subject: [PATCH 05/28] add lang[en] for remainingTime --- src/Language/en/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/en/Auth.php b/src/Language/en/Auth.php index 6f34fe3ee..8cda219ab 100644 --- a/src/Language/en/Auth.php +++ b/src/Language/en/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'The code was incorrect.', 'needActivate' => 'You must complete your registration by confirming the code sent to your email address.', 'activationBlocked' => 'You must activate your account before logging in.', + 'remainingTime' => 'You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} is not a valid group.', From e417839cafd9861efa728f1dae318f9aeb8e8c08 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:21:36 +0700 Subject: [PATCH 06/28] fix: some errors occurred --- src/Authentication/Actions/EmailActivator.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Authentication/Actions/EmailActivator.php b/src/Authentication/Actions/EmailActivator.php index 43c931c37..ffa19e35d 100644 --- a/src/Authentication/Actions/EmailActivator.php +++ b/src/Authentication/Actions/EmailActivator.php @@ -62,9 +62,11 @@ public function show(): string $timDiff = $identityCreated->difference($now); - $resendCodeVerificationTime = (setting('Auth.resendCodeVerification') - $timDiff->getSeconds()); + $configRCV = setting('Auth.resendCodeVerification'); - if ($timDiff->getSeconds() >= setting('Auth.resendCodeVerification') || $userIdentity->secret2 === null) { + $resendCodeVerificationTime = ((int) $configRCV - $timDiff->getSeconds()); + + if ($timDiff->getSeconds() >= (int) $configRCV || $userIdentity->secret2 === null) { $code = $this->createIdentity($user); /** @var IncomingRequest $request */ @@ -91,7 +93,7 @@ public function show(): string } // Add flag - model(UserIdentityModel::class) + model('UserIdentityModel') ->where('secret', $code) ->set(['secret2' => 'SEND']) ->update(); From 987b78af47f53c13aae2724d25899517c4ba4b21 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:23:53 +0700 Subject: [PATCH 07/28] fix: respect coding standards --- src/Config/Auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Config/Auth.php b/src/Config/Auth.php index 194caaaef..beceb6f20 100644 --- a/src/Config/Auth.php +++ b/src/Config/Auth.php @@ -187,7 +187,7 @@ class Auth extends BaseConfig */ public int $magicLinkLifetime = HOUR; - /** + /** * -------------------------------------------------------------------- * Resend Code Verification Time for re-new the code and send it again * -------------------------------------------------------------------- From af64d1e1a42312f682d596457f7edacab39d022a Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:30:25 +0700 Subject: [PATCH 08/28] lang: add temp lang [remainingTime] --- src/Language/ar/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/ar/Auth.php b/src/Language/ar/Auth.php index 5f44a4284..569014c63 100644 --- a/src/Language/ar/Auth.php +++ b/src/Language/ar/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'الرمز غير صحيح', 'needActivate' => 'يجب عليك إكمال تسجيل حسابك عن طريق تأكيد الرمز المرسل إلى عنوان بريدك الإلكتروني.', 'activationBlocked' => 'يجب عليك تفعيل حسابك قبل تسجيل الدخول.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} ليست مجموعة صالحة.', From 5ae1e557ff51eb2e8f8b1e913ef28a91893e42c2 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:30:57 +0700 Subject: [PATCH 09/28] lang: add temp lang [remainingTime] --- src/Language/bg/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/bg/Auth.php b/src/Language/bg/Auth.php index b34e37f86..063418507 100644 --- a/src/Language/bg/Auth.php +++ b/src/Language/bg/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Кода е невалиден.', 'needActivate' => 'Трябва да завършите регистрацията си, като потвърдите кода, изпратен на вашия имейл адрес.', 'activationBlocked' => 'Трябва да активирате акаунта си, преди да влезете.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Групи 'unknownGroup' => '{0} не е валидна група.', From 1ff731e797bb911493277adf2c612f89aff5e223 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:31:27 +0700 Subject: [PATCH 10/28] lang: add temp lang [remainingTime] --- src/Language/cs/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/cs/Auth.php b/src/Language/cs/Auth.php index 269bf2801..ca30a0773 100644 --- a/src/Language/cs/Auth.php +++ b/src/Language/cs/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kód byl nesprávný', 'needActivate' => 'Registraci musíte dokončit potvrzením kódu zaslaného na vaši e-mailovou adresu.', 'activationBlocked' => 'Před přihlášením musíte svůj účet aktivovat.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} není platná skupina.', From 44b12ae21c77007d1194fc2cf2b990c7bbc18ae9 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:32:05 +0700 Subject: [PATCH 11/28] lang: add temp lang [remainingTime] --- src/Language/de/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/de/Auth.php b/src/Language/de/Auth.php index 1517082ea..044bd07cc 100644 --- a/src/Language/de/Auth.php +++ b/src/Language/de/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Der Code war falsch.', 'needActivate' => 'Sie müssen Ihre Anmeldung abschließen, indem Sie den an Ihre E-Mail-Adresse gesendeten Code bestätigen.', 'activationBlocked' => 'Bevor Sie sich anmelden können muss das Konto aktiviert werden.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} ist eine ungültige Gruppe.', From e39f7c882c9cb096c4cccb71c2897c8a0e00c10c Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:32:48 +0700 Subject: [PATCH 12/28] lang: add temp lang [remainingTime] --- src/Language/es/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/es/Auth.php b/src/Language/es/Auth.php index 9f3797744..f535a5041 100644 --- a/src/Language/es/Auth.php +++ b/src/Language/es/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'El código era incorrecto.', 'needActivate' => 'Debes completar tu registro confirmando el código enviado a tu dirección de correo electrónico.', 'activationBlocked' => 'Debes activar tu cuenta antes de iniciar sesión.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Grupos 'unknownGroup' => '{0} no es un grupo válido.', From 3d69d09f5d47f794dcdcf3741fea078d0ed217d0 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:33:12 +0700 Subject: [PATCH 13/28] lang: add temp lang [remainingTime] --- src/Language/fa/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/fa/Auth.php b/src/Language/fa/Auth.php index e42ae39a4..80a09847d 100644 --- a/src/Language/fa/Auth.php +++ b/src/Language/fa/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'کد صحیح نمی باشد.', 'needActivate' => 'شما باید با ارائه کد ارسال شده به ایمیلتان، ثبت نام را تکمیل کنید.', 'activationBlocked' => 'قبل از تلاش برای ورود، باید اکانت خود را فعال کنید.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} گروهی معتبر نیست.', From ee8b3e69bd41741fdc5fcd0ca1d70db125fc29fc Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:33:35 +0700 Subject: [PATCH 14/28] lang: add temp lang [remainingTime] --- src/Language/fr/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/fr/Auth.php b/src/Language/fr/Auth.php index c6f8e4919..3464343bf 100644 --- a/src/Language/fr/Auth.php +++ b/src/Language/fr/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Le code était incorrect.', 'needActivate' => 'Complétez votre inscription en confirmant le code envoyé à votre email.', 'activationBlocked' => 'Vous devez activer votre compte avant de vous connecter.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} n\'est pas un groupe valide.', From b893f1398838feaee53298ba326bda3e013ddb0b Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:34:19 +0700 Subject: [PATCH 15/28] lang: add temp lang [remainingTime] --- src/Language/it/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/it/Auth.php b/src/Language/it/Auth.php index 9cafd7f48..917f4b227 100644 --- a/src/Language/it/Auth.php +++ b/src/Language/it/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Il codice era sbagliato.', 'needActivate' => 'Devi completare la registrazione confermando il codice inviato al tuo indrizzo email.', 'activationBlocked' => '(to be translated) You must activate your account before logging in.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} non è un gruppo valido.', From d5e7ba80fcc1cd03e2d546125800e34326acbf18 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:35:09 +0700 Subject: [PATCH 16/28] lang: add temp lang [remainingTime] --- src/Language/ja/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/ja/Auth.php b/src/Language/ja/Auth.php index 282335160..f43ec44e8 100644 --- a/src/Language/ja/Auth.php +++ b/src/Language/ja/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'コードが間違っています。', // 'The code was incorrect.' 'needActivate' => 'メールアドレスに送信されたコードを確認し、登録を完了する必要があります。', // 'You must complete your registration by confirming the code sent to your email address.' 'activationBlocked' => 'ログインする前にアカウントを有効化する必要があります。', // 'You must activate your account before logging in.' + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} は有効なグループではありません。', // '{0} is not a valid group.' From c8639869ca026b696163b57803b96125a3ce775b Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:35:33 +0700 Subject: [PATCH 17/28] lang: add temp lang [remainingTime] --- src/Language/lt/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/lt/Auth.php b/src/Language/lt/Auth.php index 716f6f263..33c5ea6f1 100644 --- a/src/Language/lt/Auth.php +++ b/src/Language/lt/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kodas buvo neteisingas.', 'needActivate' => 'Turite baigti registraciją panaudodami kodą, išsiųstą Jums el. pašto adresu.', 'activationBlocked' => 'Prieš prisijungdami turite aktyvuoti paskyrą.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} nėra egzistuojanti grupė.', From cfeaf550862e5006dafe3fc018c615c9b0b24187 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:35:55 +0700 Subject: [PATCH 18/28] lang: add temp lang [remainingTime] --- src/Language/nl/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/nl/Auth.php b/src/Language/nl/Auth.php index e3d082a4a..791f5705c 100644 --- a/src/Language/nl/Auth.php +++ b/src/Language/nl/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'De code was niet correct.', 'needActivate' => 'Je moet je registratie voltooien door de code te bevestigen die naar je e-mailadres is gestuurd.', 'activationBlocked' => 'Je moet je account activeren voordat je kunt inloggen.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} is geen geldige groep.', From 71f81f6b9dd2a81e849c8b497007f8e61e6a2484 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:36:17 +0700 Subject: [PATCH 19/28] lang: add temp lang [remainingTime] --- src/Language/pl/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/pl/Auth.php b/src/Language/pl/Auth.php index 06bc98456..3c8976296 100644 --- a/src/Language/pl/Auth.php +++ b/src/Language/pl/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kod był nieprawidłowy.', 'needActivate' => 'Musisz zakończyć rejestrację, potwierdzając kod wysłany na adres e-mail.', 'activationBlocked' => 'Musisz aktywować swoje konto przed zalogowaniem się.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} nie jest ważną grupą.', From d673f90d43066966e5b47d3b4fb252f2ba51481f Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:36:41 +0700 Subject: [PATCH 20/28] lang: add temp lang [remainingTime] --- src/Language/pt-BR/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/pt-BR/Auth.php b/src/Language/pt-BR/Auth.php index f8aa21912..47b7d0880 100644 --- a/src/Language/pt-BR/Auth.php +++ b/src/Language/pt-BR/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'O código estava incorreto.', 'needActivate' => 'Você deve concluir seu registro confirmando o código enviado para seu endereço de e-mail.', 'activationBlocked' => 'Você deve ativar sua conta antes de fazer o login.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Grupos 'unknownGroup' => '{0} não é um grupo válido.', From b0eaddca43bcf486e08fc818083e0f4b699c4f97 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:37:03 +0700 Subject: [PATCH 21/28] lang: add temp lang [remainingTime] --- src/Language/pt/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/pt/Auth.php b/src/Language/pt/Auth.php index 50d39b0dd..1fe6e2b18 100644 --- a/src/Language/pt/Auth.php +++ b/src/Language/pt/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'O código estava incorreto.', 'needActivate' => 'Deve concluir seu registro confirmando o código enviado para seu endereço de e-mail.', 'activationBlocked' => 'Deve ativar sua conta antes de fazer o login.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Grupos 'unknownGroup' => '{0} não é um grupo válido.', From 1d455309abc866893459c2348b8ba4e7723e2223 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:37:24 +0700 Subject: [PATCH 22/28] lang: add temp lang [remainingTime] --- src/Language/ru/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/ru/Auth.php b/src/Language/ru/Auth.php index 4efd5c58b..a7ca18996 100644 --- a/src/Language/ru/Auth.php +++ b/src/Language/ru/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Код неверный.', 'needActivate' => 'Вы должны завершить регистрацию, подтвердив код, отправленный на ваш адрес электронной почты.', 'activationBlocked' => 'Вы должны активировать свою учетную запись перед входом в систему.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} не является действительной группой.', From 8051e86b34d9cf4e5dc7ba88e443c6d69cd28e50 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:37:44 +0700 Subject: [PATCH 23/28] lang: add temp lang [remainingTime] --- src/Language/sk/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/sk/Auth.php b/src/Language/sk/Auth.php index f12c1310e..b81d99f8c 100644 --- a/src/Language/sk/Auth.php +++ b/src/Language/sk/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kód bol nesprávny', 'needActivate' => 'Registráciu musíte dokončiť potvrdením kódu zaslaného na vašu e-mailovú adresu.', 'activationBlocked' => 'Pred prihlásením si musíte aktivovať svoj účet.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} nie je platná skupina.', From cf77b8221eeb9b49a626bbd622a0bd2c2110e504 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:38:06 +0700 Subject: [PATCH 24/28] lang: add temp lang [remainingTime] --- src/Language/sr/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/sr/Auth.php b/src/Language/sr/Auth.php index 03ce96794..adb595361 100644 --- a/src/Language/sr/Auth.php +++ b/src/Language/sr/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kod nije ispravan.', 'needActivate' => 'Morate dovršiti registraciju potvrdom koda poslatog na vašu email adresu.', 'activationBlocked' => 'Morate aktivirati vaš nalog pre pristupanja sistemu.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} neispravna grupa.', From 8c86bca388aa17625afac0448883f0c2453c63af Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:38:30 +0700 Subject: [PATCH 25/28] lang: add temp lang [remainingTime] --- src/Language/sv-SE/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/sv-SE/Auth.php b/src/Language/sv-SE/Auth.php index d857e7c4b..e6dca8b79 100644 --- a/src/Language/sv-SE/Auth.php +++ b/src/Language/sv-SE/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Koden var fel.', 'needActivate' => 'Du måste slutföra registreringen genom att ange aktiveringskoden som skickats till din epostadress.', 'activationBlocked' => 'Du måste aktivera ditt konto innan du kan logga in.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} är inte en giltig grupp.', From 5499476ad84a3493b57baded2419206ecd612a47 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:38:50 +0700 Subject: [PATCH 26/28] lang: add temp lang [remainingTime] --- src/Language/tr/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/tr/Auth.php b/src/Language/tr/Auth.php index 02d2ff55e..ef31e9e3b 100644 --- a/src/Language/tr/Auth.php +++ b/src/Language/tr/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Kod yanlıştı.', 'needActivate' => 'E-posta adresinize gönderilen kodu onaylayarak kaydınızı tamamlamanız gerekmektedir.', 'activationBlocked' => 'Giriş yapmadan önce hesabınızı etkinleştirmeniz gerekmektedir.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} geçerli bir grup değil.', From 8aeca80377fa310173de34bbb31e23ce6da57060 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 17:39:16 +0700 Subject: [PATCH 27/28] lang: add temp lang [remainingTime] --- src/Language/uk/Auth.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Language/uk/Auth.php b/src/Language/uk/Auth.php index 76ea90b90..b6ffa1f34 100644 --- a/src/Language/uk/Auth.php +++ b/src/Language/uk/Auth.php @@ -107,6 +107,7 @@ 'invalidActivateToken' => 'Код був невірний.', 'needActivate' => 'Ви повинні завершити реєстрацію, підтвердивши код, надісланий на вашу електронну адресу.', 'activationBlocked' => 'Ви повинні активувати свій обліковий запис перед входом.', + 'remainingTime' => '(To be translated) You can receive a new code in {0, number} seconds.', // Groups 'unknownGroup' => '{0} недійсна група.', From 4a49a828cac2a6df2477322b3026f062fe23435a Mon Sep 17 00:00:00 2001 From: Aselsan Date: Thu, 18 Jul 2024 18:16:58 +0700 Subject: [PATCH 28/28] update the model --- src/Authentication/Actions/EmailActivator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Authentication/Actions/EmailActivator.php b/src/Authentication/Actions/EmailActivator.php index ffa19e35d..db9b1e61c 100644 --- a/src/Authentication/Actions/EmailActivator.php +++ b/src/Authentication/Actions/EmailActivator.php @@ -92,8 +92,8 @@ public function show(): string throw new RuntimeException('Cannot send email for user: ' . $user->email . "\n" . $email->printDebugger(['headers'])); } - // Add flag - model('UserIdentityModel') + /** @var UserIdentityModel $identityModel */ + model(UserIdentityModel::class) ->where('secret', $code) ->set(['secret2' => 'SEND']) ->update();