Files

30 lines
950 B
PHP
Raw Permalink Normal View History

2026-10-05 18:10:18 -04:00
<?php
declare(strict_types=1);
namespace Pterodactyl\Contracts\Users;
use PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException;
use PragmaRX\Google2FA\Exceptions\InvalidCharactersException;
use PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException;
use Pterodactyl\Exceptions\Service\User\TwoFactorAuthenticationTokenInvalid;
use Pterodactyl\Models\User;
use Throwable;
interface TogglesTwoFactor
{
/**
2026-10-11 23:50:53 -04:00
* The token must be valid.
2026-10-05 18:10:18 -04:00
*
* @return list<string> The plaintext recovery tokens generated for the account,
* empty when 2FA is being turned off.
*
* @throws Throwable
* @throws IncompatibleWithGoogleAuthenticatorException
* @throws InvalidCharactersException
* @throws SecretKeyTooShortException
* @throws TwoFactorAuthenticationTokenInvalid
*/
public function toggle(User $user, string $token, ?bool $toggleState = null): array;
}