3
0
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:
Daniel Meltzer
2018-04-16 19:38:32 -04:00
parent 61c912e2ac
commit afc8ac5e72
6 changed files with 641 additions and 347 deletions

View File

@ -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) {