up
This commit is contained in:
@@ -83,14 +83,13 @@ class ShowPerfil extends Component
|
||||
|
||||
public function confirmar()
|
||||
{
|
||||
|
||||
$validatedData = $this->validate([
|
||||
'newPassword' => 'required'
|
||||
]);
|
||||
|
||||
User::where('id', Auth()->user()->id)->update([
|
||||
'password' => Hash::make($this->newPassword),
|
||||
]);
|
||||
$user = User::findOrFail(Auth()->user()->id);
|
||||
$user->password = Hash::make($this->newPassword);
|
||||
$user->save();
|
||||
|
||||
$this->alert('success', 'Contraseña actualizada correctamente!', [
|
||||
'position' => 'top'
|
||||
|
||||
@@ -783,14 +783,20 @@ class ShowUsuarios extends Component
|
||||
|
||||
public function confirmarNewPassword()
|
||||
{
|
||||
|
||||
$validatedData = $this->validate([
|
||||
'newPassword' => 'required'
|
||||
]);
|
||||
|
||||
User::where('id', $this->pass_id)->update([
|
||||
'password' => Hash::make($this->newPassword),
|
||||
]);
|
||||
if (!$this->pass_id) {
|
||||
$this->alert('error', 'Error: no se encontró el usuario.', [
|
||||
'position' => 'top'
|
||||
]);
|
||||
return;
|
||||
}
|
||||
|
||||
$user = User::findOrFail($this->pass_id);
|
||||
$user->password = Hash::make($this->newPassword);
|
||||
$user->save();
|
||||
|
||||
$this->alert('success', 'Contraseña actualizada correctamente!', [
|
||||
'position' => 'top'
|
||||
|
||||
Reference in New Issue
Block a user