Add event-admin password reset flow
This commit is contained in:
28
app/Http/Requests/Auth/TenantAdminForgotPasswordRequest.php
Normal file
28
app/Http/Requests/Auth/TenantAdminForgotPasswordRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TenantAdminForgotPasswordRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'email' => ['required', 'email'],
|
||||
];
|
||||
}
|
||||
}
|
||||
31
app/Http/Requests/Auth/TenantAdminResetPasswordRequest.php
Normal file
31
app/Http/Requests/Auth/TenantAdminResetPasswordRequest.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Auth;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rules;
|
||||
|
||||
class TenantAdminResetPasswordRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'token' => ['required', 'string'],
|
||||
'email' => ['required', 'email'],
|
||||
'password' => ['required', 'confirmed', Rules\Password::defaults()],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ class TenantAdminTokenRequest extends FormRequest
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'login' => ['required', 'string'],
|
||||
'login' => ['required', 'email'],
|
||||
'password' => ['required', 'string'],
|
||||
];
|
||||
}
|
||||
@@ -27,10 +27,6 @@ class TenantAdminTokenRequest extends FormRequest
|
||||
{
|
||||
$login = $this->string('login')->trim()->value();
|
||||
|
||||
if (filter_var($login, FILTER_VALIDATE_EMAIL)) {
|
||||
return ['email' => $login, 'password' => $this->string('password')->value()];
|
||||
}
|
||||
|
||||
return ['username' => $login, 'password' => $this->string('password')->value()];
|
||||
return ['email' => $login, 'password' => $this->string('password')->value()];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user