From eba37bfe8421d770246d9ddc2b60b2d522a5defd Mon Sep 17 00:00:00 2001 From: RoelReijn <34895541+RoelReijn@users.noreply.github.com> Date: Sun, 27 Dec 2020 18:37:52 +0100 Subject: [PATCH] Fix for #4 Replace language strings, add styles and improve the 2fa-switch order. --- stubs/resources/views/profile/edit.blade.php | 29 +++++++++-- .../two-factor-authentication-form.blade.php | 48 +++++++------------ 2 files changed, 42 insertions(+), 35 deletions(-) diff --git a/stubs/resources/views/profile/edit.blade.php b/stubs/resources/views/profile/edit.blade.php index c949145..8e3db6c 100644 --- a/stubs/resources/views/profile/edit.blade.php +++ b/stubs/resources/views/profile/edit.blade.php @@ -19,6 +19,21 @@ @endif + @if(session('status') == 'two-factor-authentication-enabled') + {{-- Show SVG QR Code, After Enabling 2FA --}} +
+

+ {{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }} +

+
{!! auth()->user()->twoFactorQrCodeSvg() !!}
+
+ + @endif +

+

{{ __('Active Sessions') }}

+
@@ -122,20 +139,22 @@ class="avatar avatar-xl"> @csrf @method('PUT') +

{{ __('Change Password') }}

+
- +
- +
- +
@@ -147,9 +166,9 @@ class="avatar avatar-xl"> -
- @if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::twoFactorAuthentication())) +
+

{{ __('Two Factor Authentication') }}

@include('profile.two-factor-authentication-form') @endif diff --git a/stubs/resources/views/profile/two-factor-authentication-form.blade.php b/stubs/resources/views/profile/two-factor-authentication-form.blade.php index 3429898..ed0f902 100644 --- a/stubs/resources/views/profile/two-factor-authentication-form.blade.php +++ b/stubs/resources/views/profile/two-factor-authentication-form.blade.php @@ -3,50 +3,38 @@ @csrf - @else - {{-- Disable 2FA --}} - - @csrf - @method('DELETE') - - - - - @if(session('status') == 'two-factor-authentication-enabled') - {{-- Show SVG QR Code, After Enabling 2FA --}} -
- {{ __('Two factor authentication is now enabled. Scan the following QR code using your phone\'s authenticator application.') }} -
- -
- {!! auth()->user()->twoFactorQrCodeSvg() !!} -
- @endif - {{-- Show 2FA Recovery Codes --}} -
+

{{ __('Store these recovery codes in a secure password manager. They can be used to recover access to your account if your two factor authentication device is lost.') }} -

+

-
+
    @foreach (json_decode(decrypt(auth()->user()->two_factor_recovery_codes), true) as $code) -
    {{ $code }}
    +
  • {{ $code }}
  • @endforeach -
+ {{-- Regenerate 2FA Recovery Codes --}} - + + @csrf + + + {{-- Disable 2FA --}} + @csrf + @method('DELETE') - + + @endif -