Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add login link to magic link form view #730

Merged
merged 2 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Language/bg/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Проверете вашия имейл!',
'magicLinkDetails' => 'Току що ви изпратихме имейл с линк за вход. Линкът ще бъде валиден само {0} минути.',
'successLogout' => 'Успешно излязохте от системата.',
'backToLogin' => 'Обратно към входа',

// Пароли
'errorPasswordLength' => 'Паролите трябва да са поне {0, number} символа дълги.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/de/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Prüfen Sie Ihre E-Mail!',
'magicLinkDetails' => 'Wir haben Ihnen gerade eine E-Mail mit einem Login-Link geschickt. Er ist nur für {0} Minuten gültig.',
'successLogout' => 'Sie haben sich erfolgreich abgemeldet.',
'backToLogin' => 'Zurück zur Anmeldung',

// Passwords
'errorPasswordLength' => 'Passwörter müssen mindestens {0, number} Zeichen lang sein.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/en/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Check your email!',
'magicLinkDetails' => 'We just sent you an email with a Login link inside. It is only valid for {0} minutes.',
'successLogout' => 'You have successfully logged out.',
'backToLogin' => 'Back to Login',

// Passwords
'errorPasswordLength' => 'Passwords must be at least {0, number} characters long.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/es/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => '¡Revisa tu correo electrónico!',
'magicLinkDetails' => 'Acabamos de enviarte un correo electrónico con un enlace de inicio de sesión. Solo es válido durante {0} minutos.',
'successLogout' => 'Has cerrado sesión correctamente.',
'backToLogin' => 'Volver al inicio de sesión',

// Contraseñas
'errorPasswordLength' => 'Las contraseñas deben tener al menos {0, number} caracteres.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/fa/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'ایمیلتان را بررسی کنید!',
'magicLinkDetails' => 'ما فقط یک لینک ورود به ایمیلتان ارسال کردیم. این لینک فقط برای {0} دقیقه معتبر خواهد بود.',
'successLogout' => 'با موفقیت خارج شدید.',
'backToLogin' => 'بازگشت به ورود به سیستم',

// Passwords
'errorPasswordLength' => 'طول رمز های عبور باید حداقل {0, number} کاراکتر باشد.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/fr/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Vérifier votre email !',
'magicLinkDetails' => 'Nous venons de vous envoyer un email contenant un lien de connexion. Il n\'est valable que {0} minutes.',
'successLogout' => 'Vous avez été déconnecté avec succès.',
'backToLogin' => 'Retour à la connexion',

// Passwords
'errorPasswordLength' => 'Le mot de passe doit contenir au moins {0, number} caractères.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/id/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Periksa email Anda!',
'magicLinkDetails' => 'Kami baru saja mengirimi Anda email dengan tautan Masuk di dalamnya. Ini hanya berlaku selama {0} menit.',
'successLogout' => 'Anda telah berhasil keluar.',
'backToLogin' => 'Kembali ke masuk',

// Passwords
'errorPasswordLength' => 'Kata sandi harus setidaknya terdiri dari {0, number} karakter.',
Expand Down
3 changes: 2 additions & 1 deletion src/Language/it/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,14 @@
'needAccount' => 'Hai bisogno di un account?',
'rememberMe' => 'Ricordami?',
'forgotPassword' => 'Password dimenticata?',
'useMagicLink' => 'Usa un Login Link',
'useMagicLink' => 'Usa un Login Link',
'magicLinkSubject' => 'Il tuo Login Link',
'magicTokenNotFound' => 'Impossibile verificare il link.',
'magicLinkExpired' => 'Spiacente, il link è scaduto.',
'checkYourEmail' => 'Controlla la tua email!',
'magicLinkDetails' => 'Ti abbiamo appena inviato una mail contenente un Login link. È valido solo per {0} minuti.',
'successLogout' => 'Hai effettuato il logout con successo.',
'backToLogin' => 'Torna al login',

// Passwords
'errorPasswordLength' => 'Le password devono essere lunghe almeno {0, number} ccaratteri.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/ja/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'メールをチェックしてください!', // 'Check your email!'
'magicLinkDetails' => 'ログインリンクが含まれたメールを送信しました。これは {0} 分間だけ有効です。', // 'We just sent you an email with a Login link inside. It is only valid for {0} minutes.'
'successLogout' => '正常にログアウトしました。', // 'You have successfully logged out.'
'backToLogin' => 'ログインに戻る', // 'Back to Login'

// Passwords
'errorPasswordLength' => 'パスワードは最低でも {0, number} 文字でなければなりません。', // 'Passwords must be at least {0, number} characters long.'
Expand Down
1 change: 1 addition & 0 deletions src/Language/lt/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Patikrinkite savo el. paštą!',
'magicLinkDetails' => 'Mes ką tik išsiuntėme Jums el. laišką su prisijungimo nuoroda. Ji galios tiki {0} minučių(-es).',
'successLogout' => 'Jūs sėkmingai atsijungėte.',
'backToLogin' => 'Grįžti į prisijungimą',

// Passwords
'errorPasswordLength' => 'Slaptažodis turi būti bent {0, number} ženklų ilgio.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/pt-BR/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Verifique seu e-mail!',
'magicLinkDetails' => 'Acabamos de enviar um e-mail com um link de Login. Ele é válido apenas por {0} minutos.',
'successLogout' => 'Você saiu com sucesso.',
'backToLogin' => 'Voltar para o login',

// Senhas
'errorPasswordLength' => 'As senhas devem ter pelo menos {0, number} caracteres.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/pt/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Verifique o seu e-mail!',
'magicLinkDetails' => 'Acabamos de enviar um e-mail com um link de Login. Ele é válido apenas por {0} minutos.',
'successLogout' => 'Saiu com sucesso.',
'backToLogin' => 'Voltar ao login',

// Senhas
'errorPasswordLength' => 'As passwords devem ter pelo menos {0, number} caracteres.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/sk/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Skontrolujte e-mail',
'magicLinkDetails' => 'Práve sme vám poslali e-mail s odkazom na prihlásenie. Platí iba {0} minút.',
'successLogout' => 'Úspešne ste sa odhlásili.',
'backToLogin' => 'Späť na prihlásenie',

// Passwords
'errorPasswordLength' => 'Heslá musia mať aspoň {0, number} znakov.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/sr/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Proverite Vaš email!',
'magicLinkDetails' => 'Upravo smo Vam poslali pristupni link. Pristupni link će biti validan još samo {0} minuta.',
'successLogout' => 'Uspešno ste se odjavili sa sistema.',
'backToLogin' => 'Nazad na prijavljivanje',

// Passwords
'errorPasswordLength' => 'Lozinka mora biti najmanje {0, number} znakova dužine.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/sv-SE/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Kontrollera din epost!',
'magicLinkDetails' => 'En login-länk har skickats med epost. Den gäller bara i {0} minuter.',
'successLogout' => 'Du har loggats ut.',
'backToLogin' => 'Tillbaka till inloggning',

// Passwords
'errorPasswordLength' => 'Lösenordet måste vara minst {0, number} tecken långt.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/tr/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'E-postanı kontrol et!',
'magicLinkDetails' => 'Az önce size içinde bir Giriş bağlantısı olan bir e-posta gönderdik. Bağlantı {0} dakika için geçerlidir.',
'successLogout' => 'Başarıyla çıkış yaptınız.',
'backToLogin' => 'Girişe Geri Dön',

// Passwords
'errorPasswordLength' => 'Şifre en az {0, number} karakter uzunluğunda olmalıdır.',
Expand Down
1 change: 1 addition & 0 deletions src/Language/uk/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
'checkYourEmail' => 'Перевірте свою електронну пошту!',
'magicLinkDetails' => 'Ми щойно надіслали вам електронний лист із посиланням для входу. Він дійсний лише протягом {0} хвилин.',
'successLogout' => 'Ви успішно вийшли.',
'backToLogin' => 'Повернутися до входу',

// Passwords
'errorPasswordLength' => 'Паролі повинні містити принаймні {0, числових} символів.',
Expand Down
2 changes: 2 additions & 0 deletions src/Views/magic_link_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
</div>

</form>

<p class="text-center"><a href="<?= url_to('login') ?>"><?= lang('Auth.backToLogin') ?></a></p>
</div>
</div>
</div>
Expand Down
6 changes: 6 additions & 0 deletions tests/Controllers/MagicLinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,10 @@ public function testMagicLinkVerifyPendingRegistrationActivation(): void
);
$this->assertFalse(auth()->loggedIn());
}

public function testBackToLoginLinkOnPage(): void
{
$result = $this->get('/login/magic-link');
$this->assertStringContainsString(lang('Auth.backToLogin'), $result->getBody());
}
}