Add base logic to configure two factor on account

This commit is contained in:
Dane Everitt
2019-12-22 17:03:44 -08:00
parent edf27a5542
commit eb39826f46
15 changed files with 389 additions and 54 deletions

View File

@@ -65,7 +65,9 @@ class ToggleTwoFactorService
$isValidToken = $this->google2FA->verifyKey($secret, $token, config()->get('pterodactyl.auth.2fa.window'));
if (! $isValidToken) {
throw new TwoFactorAuthenticationTokenInvalid;
throw new TwoFactorAuthenticationTokenInvalid(
'The token provided is not valid.'
);
}
$this->repository->withoutFreshModel()->update($user->id, [