mirror of
https://github.com/snipe/snipe-it.git
synced 2026-04-30 19:56:29 +00:00
Php7 updates (#5365)
* Update composer dependencies. * Update google2fa to version 3 and make adjustments related to it. * Update to league/csv 9 * Fix api categories test. we were passing the wrong parameter to the url which caused the wrong data to be fetched.
This commit is contained in:
@ -208,15 +208,20 @@ class LoginController extends Controller
|
||||
}
|
||||
|
||||
$user = Auth::user();
|
||||
$google2fa = app()->make('PragmaRX\Google2FA\Contracts\Google2FA');
|
||||
$google2fa = app()->make('pragmarx.google2fa');
|
||||
|
||||
if ($user->two_factor_secret=='') {
|
||||
$user->two_factor_secret = $google2fa->generateSecretKey(32);
|
||||
$user->save();
|
||||
}
|
||||
|
||||
// $google2fa_url = $google2fa->getQRCodeGoogleUrl(
|
||||
// urlencode(Setting::getSettings()->site_name),
|
||||
// urlencode($user->username),
|
||||
// $user->two_factor_secret
|
||||
// );
|
||||
|
||||
$google2fa_url = $google2fa->getQRCodeGoogleUrl(
|
||||
$google2fa_url = $google2fa->getQRCodeInline(
|
||||
urlencode(Setting::getSettings()->site_name),
|
||||
urlencode($user->username),
|
||||
$user->two_factor_secret
|
||||
@ -251,7 +256,7 @@ class LoginController extends Controller
|
||||
|
||||
$user = Auth::user();
|
||||
$secret = $request->get('two_factor_secret');
|
||||
$google2fa = app()->make('PragmaRX\Google2FA\Contracts\Google2FA');
|
||||
$google2fa = app()->make('pragmarx.google2fa');
|
||||
$valid = $google2fa->verifyKey($user->two_factor_secret, $secret);
|
||||
|
||||
if ($valid) {
|
||||
|
||||
Reference in New Issue
Block a user