mirror of
https://github.com/snipe/snipe-it.git
synced 2026-03-29 11:56:19 +00:00
Allow certain users to override 2FA with permission
This commit is contained in:
@ -9,6 +9,7 @@ use View;
|
||||
use Auth;
|
||||
use App\Helpers\Helper;
|
||||
use App\Models\Setting;
|
||||
use Gate;
|
||||
|
||||
/**
|
||||
* This controller handles all actions related to User Profiles for
|
||||
@ -54,7 +55,8 @@ class ProfileController extends Controller
|
||||
$user->gravatar = e(Input::get('gravatar'));
|
||||
$user->locale = e(Input::get('locale'));
|
||||
|
||||
if ((Setting::getSettings()->two_factor_enabled=='1') && (!config('app.lock_passwords'))) {
|
||||
|
||||
if ((Gate::allows('self.two_factor')) && ((Setting::getSettings()->two_factor_enabled=='1') && (!config('app.lock_passwords')))) {
|
||||
$user->two_factor_optin = e(Input::get('two_factor_optin', '0'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user