Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Http/Requests/Auth/LoginCheckpointRequest.php
10266 views
1
<?php
2
3
namespace Pterodactyl\Http\Requests\Auth;
4
5
use Illuminate\Validation\Rule;
6
use Illuminate\Foundation\Http\FormRequest;
7
8
class LoginCheckpointRequest extends FormRequest
9
{
10
/**
11
* Determine if the request is authorized.
12
*/
13
public function authorize(): bool
14
{
15
return true;
16
}
17
18
/**
19
* Rules to apply to the request.
20
*/
21
public function rules(): array
22
{
23
return [
24
'confirmation_token' => 'required|string',
25
'authentication_code' => [
26
'nullable',
27
'numeric',
28
Rule::requiredIf(function () {
29
return empty($this->input('recovery_token'));
30
}),
31
],
32
'recovery_token' => [
33
'nullable',
34
'string',
35
Rule::requiredIf(function () {
36
return empty($this->input('authentication_code'));
37
}),
38
],
39
];
40
}
41
}
42
43