Only offer the 2FA reset if the user already has 2FA set up

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-03-20 23:52:51 +00:00
parent 5ed2bd0fb7
commit 945e8b402f
2 changed files with 15 additions and 12 deletions

View file

@ -499,6 +499,7 @@
</div>
@endif
@if ((Auth::user()->isSuperUser()) && ($user->two_factor_active_and_enrolled()) && ($snipeSettings->two_factor_enabled!='0') && ($snipeSettings->two_factor_enabled!=''))
<!-- Reset Two Factor -->
<div class="form-group">
<div class="col-md-8 col-md-offset-3 two_factor_resetrow">
@ -513,6 +514,8 @@
</div>
@endif
@endif
<!-- Groups -->
<div class="form-group{{ $errors->has('groups') ? ' has-error' : '' }}">
<label class="col-md-3 control-label" for="groups[]"> {{ trans('general.groups') }}</label>

View file

@ -597,7 +597,7 @@
</div>
</div>
@if ((Auth::user()->isSuperUser()) && ($snipeSettings->two_factor_enabled!='0') && ($snipeSettings->two_factor_enabled!=''))
@if ((Auth::user()->isSuperUser()) && ($user->two_factor_active_and_enrolled()) && ($snipeSettings->two_factor_enabled!='0') && ($snipeSettings->two_factor_enabled!=''))
<!-- 2FA reset -->
<div class="row">