mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Merge branch 'totp-patch' into development
This commit is contained in:
commit
c9d9ad10f2
@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
<p class="small mb-m">{{ trans('auth.mfa_verify_backup_code_desc') }}</p>
|
<p class="small mb-m">{{ trans('auth.mfa_verify_backup_code_desc') }}</p>
|
||||||
|
|
||||||
<form action="{{ url('/mfa/backup_codes/verify') }}" method="post">
|
<form action="{{ url('/mfa/backup_codes/verify') }}" method="post" autocomplete="off">
|
||||||
{{ csrf_field() }}
|
{{ csrf_field() }}
|
||||||
<input type="text"
|
<input type="text"
|
||||||
name="code"
|
name="code"
|
||||||
|
autocomplete="one-time-code"
|
||||||
placeholder="{{ trans('auth.mfa_verify_backup_code_enter_here') }}"
|
placeholder="{{ trans('auth.mfa_verify_backup_code_enter_here') }}"
|
||||||
class="input-fill-width {{ $errors->has('code') ? 'neg' : '' }}">
|
class="input-fill-width {{ $errors->has('code') ? 'neg' : '' }}">
|
||||||
@if($errors->has('code'))
|
@if($errors->has('code'))
|
||||||
|
@ -2,10 +2,11 @@
|
|||||||
|
|
||||||
<p class="small mb-m">{{ trans('auth.mfa_verify_totp_desc') }}</p>
|
<p class="small mb-m">{{ trans('auth.mfa_verify_totp_desc') }}</p>
|
||||||
|
|
||||||
<form action="{{ url('/mfa/totp/verify') }}" method="post">
|
<form action="{{ url('/mfa/totp/verify') }}" method="post" autocomplete="off">
|
||||||
{{ csrf_field() }}
|
{{ csrf_field() }}
|
||||||
<input type="text"
|
<input type="text"
|
||||||
name="code"
|
name="code"
|
||||||
|
autocomplete="one-time-code"
|
||||||
autofocus
|
autofocus
|
||||||
placeholder="{{ trans('auth.mfa_gen_totp_provide_code_here') }}"
|
placeholder="{{ trans('auth.mfa_gen_totp_provide_code_here') }}"
|
||||||
class="input-fill-width {{ $errors->has('code') ? 'neg' : '' }}">
|
class="input-fill-width {{ $errors->has('code') ? 'neg' : '' }}">
|
||||||
|
@ -57,6 +57,15 @@ class MfaVerificationTest extends TestCase
|
|||||||
$this->assertNull(auth()->user());
|
$this->assertNull(auth()->user());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_totp_form_has_autofill_configured()
|
||||||
|
{
|
||||||
|
[$user, $secret, $loginResp] = $this->startTotpLogin();
|
||||||
|
$html = $this->withHtml($this->get('/mfa/verify'));
|
||||||
|
|
||||||
|
$html->assertElementExists('form[autocomplete="off"][action$="/verify"]');
|
||||||
|
$html->assertElementExists('input[autocomplete="one-time-code"][name="code"]');
|
||||||
|
}
|
||||||
|
|
||||||
public function test_backup_code_verification()
|
public function test_backup_code_verification()
|
||||||
{
|
{
|
||||||
[$user, $codes, $loginResp] = $this->startBackupCodeLogin();
|
[$user, $codes, $loginResp] = $this->startBackupCodeLogin();
|
||||||
@ -138,6 +147,15 @@ class MfaVerificationTest extends TestCase
|
|||||||
$resp->assertSeeText('You have less than 5 backup codes remaining, Please generate and store a new set before you run out of codes to prevent being locked out of your account.');
|
$resp->assertSeeText('You have less than 5 backup codes remaining, Please generate and store a new set before you run out of codes to prevent being locked out of your account.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_backup_code_form_has_autofill_configured()
|
||||||
|
{
|
||||||
|
[$user, $codes, $loginResp] = $this->startBackupCodeLogin();
|
||||||
|
$html = $this->withHtml($this->get('/mfa/verify'));
|
||||||
|
|
||||||
|
$html->assertElementExists('form[autocomplete="off"][action$="/verify"]');
|
||||||
|
$html->assertElementExists('input[autocomplete="one-time-code"][name="code"]');
|
||||||
|
}
|
||||||
|
|
||||||
public function test_both_mfa_options_available_if_set_on_profile()
|
public function test_both_mfa_options_available_if_set_on_profile()
|
||||||
{
|
{
|
||||||
$user = $this->users->editor();
|
$user = $this->users->editor();
|
||||||
|
Loading…
Reference in New Issue
Block a user