mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 06:13:45 +02:00
Support using recovery tokens during the login process to bypass 2fa; closes #479
This commit is contained in:
@@ -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 New Issue
Block a user