mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 14:53:45 +02:00
Refactor auth controllers to be cleaner and easier to maintain
This commit is contained in:
31
app/Http/Requests/Auth/LoginCheckpointRequest.php
Normal file
31
app/Http/Requests/Auth/LoginCheckpointRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginCheckpointRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the request is authorized.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rules to apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'confirmation_token' => 'required|string',
|
||||
'authentication_code' => 'required|int',
|
||||
];
|
||||
}
|
||||
}
|
||||
27
app/Http/Requests/Auth/LoginRequest.php
Normal file
27
app/Http/Requests/Auth/LoginRequest.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class LoginRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function authorized(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'user' => 'required|string|min:1',
|
||||
'password' => 'required|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user