Support using recovery tokens during the login process to bypass 2fa; closes #479
This commit is contained in:
parent
795e045950
commit
7b75e7a648
7 changed files with 84 additions and 30 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Pterodactyl\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginCheckpointRequest extends FormRequest
|
||||
|
@ -25,7 +26,20 @@ class LoginCheckpointRequest extends FormRequest
|
|||
{
|
||||
return [
|
||||
'confirmation_token' => 'required|string',
|
||||
'authentication_code' => 'required|numeric',
|
||||
'authentication_code' => [
|
||||
'nullable',
|
||||
'numeric',
|
||||
Rule::requiredIf(function () {
|
||||
return empty($this->input('recovery_token'));
|
||||
}),
|
||||
],
|
||||
'recovery_token' => [
|
||||
'nullable',
|
||||
'string',
|
||||
Rule::requiredIf(function () {
|
||||
return empty($this->input('authentication_code'));
|
||||
}),
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue