Two factor (#47)

* init 2fa

* fix code style
This commit is contained in:
Saeed Vaziry
2023-09-11 20:47:44 +02:00
committed by GitHub
parent 13d4529d42
commit 9030427f78
24 changed files with 652 additions and 259 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace App\Actions\User;
use App\Models\User;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Laravel\Fortify\Contracts\ResetsUserPasswords;
class ResetUserPassword implements ResetsUserPasswords
{
use PasswordValidationRules;
/**
* Validate and reset the user's forgotten password.
*
* @param array<string, string> $input
*/
public function reset(User $user, array $input): void
{
Validator::make($input, [
'password' => $this->passwordRules(),
])->validate();
$user->forceFill([
'password' => Hash::make($input['password']),
])->save();
}
}