feat: 2fa reset notifs

Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
2022-09-21 05:43:11 +01:00
parent 3122c23eb4
commit f3996bb68c
9 changed files with 141 additions and 10 deletions

View File

@@ -59,9 +59,6 @@
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script id="help-ukraine-win" async="true" src="https://helpukrainewinwidget.org/cdn/widget.js" data-type="four" data-position="bottom-left"></script>
</head>
<!--Main Navigation-->
@@ -113,7 +110,7 @@
<div class="container text-center white-text">
<div class="white-text text-center wow fadeInUp">
<h2>{{config('app.name')}}</h2>
<h5>{{ __('Welcome to the Games Club Recruitment Portal!') }}</h5>
<h5>{{ __('Welcome to the :appName Recruitment Portal!', ['appName' => config('app.name')]) }}</h5>
<br>
<p>{{ __('We process applications for our Discord server\'s management team here. If you have any questions, don\'t hesistate to contact our support team! Take a look at the open jobs below.') }}</p>
<p>{!! __('If you\'d like to learn more about our community, make sure to visit our <a href=":mainWebsiteUrlConfigValue" target="_blank">main website</a>!', ['mainWebsiteUrlConfigValue' => config('app.sitehomepage')]) !!}</p>

View File

@@ -3,7 +3,7 @@
<label for="otp">{{ __('Two-factor authentication code') }}</label>
<input type="text" id="otp" name="otp" class="form-control">
<p class="text-muted text-sm"><i class="fas fa-info-circle"></i> $slot</p>
<p class="text-muted text-sm"><i class="fas fa-info-circle"></i> {{ $slot }}</p>
</div>
@endif

View File

@@ -15,9 +15,37 @@
@section('content')
<x-modal id="resetAccountPasswordModal" modal-label="resetAccountPassword" modal-title="{{ __('Confirm your password') }}" include-close-button="true">
@if($user->has2FA())
<p>{{ __('Please confirm that you want to invalidate this account\'s password. Since this is a sensitive operation, you\'ll need to confirm your own password and provide a 2FA code, if enabled.') }}</p>
<x-modal id="resetTwoFactorModal" modal-label="resetTwoFactor" modal-title="{{ __('Verify your identity') }}" include-close-button="true">
<p>{{ __('Resetting an account\'s two-factor authentication secret will automatically notify the account holder. Additionally, the user\'s password will also be forcefully reset during this process. Please confirm this action by verifying your identity below.') }}</p>
<form id="resetAccountTwofaForm" method="POST" action="{{ route('reset-twofa', ['user' => $user]) }}">
@csrf
@method('PATCH')
<x-confirm-password>
{{ __('Please re-enter your password.') }}
</x-confirm-password>
<x-confirm-second-factor>
{{ __('Please enter your two-factor authentication code.') }}
</x-confirm-second-factor>
</form>
<x-slot:modalFooter>
<button onclick="$('#resetAccountTwofaForm').submit()" type="button" class="btn btn-warning"><i class="fas fa-check"></i> {{ __('Re-authenticate and verify') }}</button>
</x-slot:modalFooter>
</x-modal>
@endif
<x-modal id="resetAccountPasswordModal" modal-label="resetAccountPassword" modal-title="{{ __('Verify your identity') }}" include-close-button="true">
<p>{{ __('Forcing a password reset will automatically notify the account holder and send them a password reset link. Please confirm this action by verifying your identity below.') }}</p>
<form id="resetAccountPasswordForm" method="POST" action="{{ route('force-reset-user', ['user' => $user]) }}">
@csrf
@@ -34,7 +62,7 @@
</form>
<x-slot name="modalFooter">
<button onclick="$('#resetAccountPasswordForm').submit()" type="button" class="btn btn-warning"><i class="fas fa-check"></i> {{ __('Re-authenticate and confirm') }}</button>
<button onclick="$('#resetAccountPasswordForm').submit()" type="button" class="btn btn-warning"><i class="fas fa-check"></i> {{ __('Re-authenticate and verify') }}</button>
</x-slot>
</x-modal>
@@ -388,7 +416,9 @@
</form>
@endif
<button onclick="$('#resetAccountPasswordModal').modal('show')" class="btn-danger btn mr-3" type="button"><i class="fas fa-key"></i> {{ __('Force password reset') }}</button>
<button class="btn-danger btn mr-3" type="button"><i class="fas fa-unlock"></i> {{ __('Reset MFA') }}</button>
@if($user->has2FA())
<button onclick="$('#resetTwoFactorModal').modal('show')" class="btn-danger btn mr-3" type="button"><i class="fas fa-unlock"></i> {{ __('Reset MFA') }}</button>
@endif
<button onclick="$('#deleteAccount').modal('show')" type="button" class="btn btn-danger"><i class="fas fa-trash"></i> {{ __('Delete account') }}</button>
</div>
</div>

View File

@@ -0,0 +1,12 @@
@component('mail::message')
# Hi {{ $name }},
Important security notification regarding your account at {{ config('app.name') }}:
Your account was previously secured with two-factor authentication. This is no longer the case. An administrator has disabled two-factor authentication for your account. Admins only reset two-factor authentication after an identity verification is complete.
As a result of this action and as an additional security measure, your password has also been voided, which means you'll need to [reset it]({{ route('password.email') }}) if you want to keep using the app.
Thank you,<br>
The team at {{ config('app.name') }}
@endcomponent