upgraded google2fa (0.7->5.0) & composer deps

This commit is contained in:
Max Kovalenko
2019-05-24 20:20:57 +03:00
committed by Max Kovalenko
parent 415aeca86a
commit 6086a275bf
6 changed files with 276 additions and 146 deletions

View File

@@ -22,7 +22,7 @@ use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\View;
use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA;
use PragmaRX\Google2FA\Google2FA;
class AuthController extends Controller
{
@@ -90,6 +90,9 @@ class AuthController extends Controller
* This feels very hacky, but we have to juggle authentication and codes.
*
* @return \Illuminate\Http\RedirectResponse
* @throws \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException
* @throws \PragmaRX\Google2FA\Exceptions\InvalidCharactersException
* @throws \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException
*/
public function postTwoFactor()
{
@@ -102,7 +105,8 @@ class AuthController extends Controller
$user = Auth::user();
$valid = Google2FA::verifyKey($user->google_2fa_secret, $code);
$google2fa = new Google2FA();
$valid = $google2fa->verifyKey($user->google_2fa_secret, $code);
if ($valid) {
event(new UserPassedTwoAuthEvent($user));