Block API access when 2FA is required on account; closes #2791

This commit is contained in:
Dane Everitt 2020-12-06 13:56:14 -08:00
parent 5d23d894ae
commit d22456d9ca
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
8 changed files with 101 additions and 40 deletions

View file

@ -0,0 +1,21 @@
<?php
namespace Pterodactyl\Exceptions\Http;
use Throwable;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
class TwoFactorAuthRequiredException extends HttpException implements HttpExceptionInterface
{
/**
* TwoFactorAuthRequiredException constructor.
*
* @param \Throwable|null $previous
*/
public function __construct(Throwable $previous = null)
{
parent::__construct(Response::HTTP_BAD_REQUEST, "Two-factor authentication is required on this account in order to access this endpoint.", $previous);
}
}