1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Updated 2FA error message response

This commit is contained in:
David Bomba 2024-02-19 17:28:15 +11:00
parent 4d4e3745f1
commit e87c618778
2 changed files with 4 additions and 2 deletions

View File

@ -30,8 +30,6 @@ class SmtpController extends BaseController
$user = auth()->user();
$company = $user->company();
config([
'mail.mailers.smtp' => [
'transport' => 'smtp',

View File

@ -72,6 +72,10 @@ class TwoFactorController extends BaseController
return response()->json(['message' => ctrans('texts.enabled_two_factor')], 200);
} elseif (! $secret || ! $google2fa->verifyKey($secret, $oneTimePassword)) {
return response()->json(['message' => ctrans('texts.invalid_one_time_password')], 400);
}elseif (! $user->phone) {
return response()->json(['message' => ctrans('texts.set_phone_for_two_factor')], 400);
} elseif (! $user->isVerified()) {
return response()->json(['message' => 'Please confirm your account first'], 400);
}
return response()->json(['message' => 'No phone record or user is not confirmed'], 400);