mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix 2FA check #1125
This commit is contained in:
parent
554b38ccff
commit
4b789979ac
@ -125,7 +125,7 @@ class UserController extends Controller
|
||||
$list = ['twoFactorAuthEnabled', 'twoFactorAuthSecret'];
|
||||
$preferences = Preferences::getArrayForUser($user, $list);
|
||||
$user->isAdmin = $user->hasRole('owner');
|
||||
$is2faEnabled = true === $preferences['twoFactorAuthEnabled'];
|
||||
$is2faEnabled = 1 === $preferences['twoFactorAuthEnabled'];
|
||||
$has2faSecret = null !== $preferences['twoFactorAuthSecret'];
|
||||
$user->has2FA = ($is2faEnabled && $has2faSecret) ? true : false;
|
||||
$user->prefs = $preferences;
|
||||
|
@ -5,7 +5,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form method="POST" action="{{ route('preferences.code.store') }}" accept-charset="UTF-8" class="form-horizontal" id="preferences.code">
|
||||
<form method="POST" action="{{ route('preferences.code.store') }}" accept-charset="UTF-8" class="form-horizontal" id="preferences_code">
|
||||
<input name="_token" type="hidden" value="{{ csrf_token() }}">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
@ -40,7 +40,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- form close -->
|
||||
</form>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
"use strict";
|
||||
|
||||
// Focus first visible form element.
|
||||
$("form#preferences_code input:enabled:visible:first").first().select();
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue
Block a user