Merge pull request #5126 from turbo124/v5-develop

Fixes for 2FA
This commit is contained in:
David Bomba 2021-03-15 07:19:10 +11:00 committed by GitHub
commit 1934443bff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ class TwoFactorController extends BaseController
$secret = request()->input('secret'); $secret = request()->input('secret');
$oneTimePassword = request()->input('one_time_password'); $oneTimePassword = request()->input('one_time_password');
if (! $secret || ! \Google2FA::verifyKey($secret, $oneTimePassword)) { if (! $secret || ! Google2FA::verifyKey($secret, $oneTimePassword)) {
return response()->json('message' > ctrans('texts.invalid_one_time_password')); return response()->json('message' > ctrans('texts.invalid_one_time_password'));
} elseif (! $user->google_2fa_secret && $user->phone && $user->confirmed) { } elseif (! $user->google_2fa_secret && $user->phone && $user->confirmed) {
$user->google_2fa_secret = encrypt($secret); $user->google_2fa_secret = encrypt($secret);