mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 23:54:30 -04:00
Check user is confirmed for 2FA
This commit is contained in:
parent
c39f57fcb5
commit
5083d44b0a
@ -11,7 +11,7 @@ class TwoFactorController extends Controller
|
|||||||
{
|
{
|
||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
|
|
||||||
if ($user->google_2fa_secret || ! $user->phone) {
|
if ($user->google_2fa_secret || ! $user->phone || ! $user->confirmed) {
|
||||||
return redirect('/settings/user_details');
|
return redirect('/settings/user_details');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ class TwoFactorController extends Controller
|
|||||||
$user = auth()->user();
|
$user = auth()->user();
|
||||||
$secret = session()->pull('2fa:secret');
|
$secret = session()->pull('2fa:secret');
|
||||||
|
|
||||||
if ($secret && ! $user->google_2fa_secret && $user->phone) {
|
if ($secret && ! $user->google_2fa_secret && $user->phone && $user->confirmed) {
|
||||||
$user->google_2fa_secret = Crypt::encrypt($secret);
|
$user->google_2fa_secret = Crypt::encrypt($secret);
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
!!}
|
!!}
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if ($user->confirmed)
|
||||||
@if ($user->google_2fa_secret)
|
@if ($user->google_2fa_secret)
|
||||||
{!! Former::checkbox('enable_two_factor')
|
{!! Former::checkbox('enable_two_factor')
|
||||||
->help(trans('texts.enable_two_factor_help'))
|
->help(trans('texts.enable_two_factor_help'))
|
||||||
@ -63,7 +64,7 @@
|
|||||||
{!! Former::plaintext('enable_two_factor')
|
{!! Former::plaintext('enable_two_factor')
|
||||||
->value('<span class="text-muted">' . trans('texts.set_phone_for_two_factor') . '</span>') !!}
|
->value('<span class="text-muted">' . trans('texts.set_phone_for_two_factor') . '</span>') !!}
|
||||||
@endif
|
@endif
|
||||||
|
@endif
|
||||||
|
|
||||||
{!! Former::checkbox('dark_mode')
|
{!! Former::checkbox('dark_mode')
|
||||||
->help(trans('texts.dark_mode_help'))
|
->help(trans('texts.dark_mode_help'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user