mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-07 06:26:10 -04:00
Add audit levels and record user, OAuth, DNS, notification, and settings changes while removing the obsolete scheduled job monitoring UI and services.
37 lines
1.1 KiB
PHP
37 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Actions\Fortify;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Support\Facades\Hash;
|
|
use Illuminate\Support\Facades\Validator;
|
|
use Illuminate\Validation\Rules\Password;
|
|
use Laravel\Fortify\Contracts\UpdatesUserPasswords;
|
|
|
|
class UpdateUserPassword implements UpdatesUserPasswords
|
|
{
|
|
/**
|
|
* Validate and update the user's password.
|
|
*
|
|
* @param array<string, string> $input
|
|
*/
|
|
public function update(User $user, array $input): void
|
|
{
|
|
Validator::make($input, [
|
|
'current_password' => ['required', 'string', 'current_password:web'],
|
|
'password' => ['required', Password::defaults(), 'confirmed'],
|
|
], [
|
|
'current_password.current_password' => __('The provided password does not match your current password.'),
|
|
])->validateWithBag('updatePassword');
|
|
|
|
$user->fill([
|
|
'password' => Hash::make($input['password']),
|
|
])->save();
|
|
auditLog('ui.user.password_changed', [
|
|
'team_id' => $user->currentTeam()?->id,
|
|
'resource' => 'user',
|
|
'user_name' => $user->name,
|
|
]);
|
|
}
|
|
}
|