From 81d0405a11a0ede41ddb2896a2f20131ca7047c1 Mon Sep 17 00:00:00 2001 From: Pablo Date: Mon, 14 Oct 2024 15:42:42 -0400 Subject: [PATCH] Teste de atualizacao --- src/app/Observers/UserObserver.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/Observers/UserObserver.php b/src/app/Observers/UserObserver.php index 3f4272b..4da153b 100644 --- a/src/app/Observers/UserObserver.php +++ b/src/app/Observers/UserObserver.php @@ -13,9 +13,6 @@ class UserObserver public function updating($user): void { PasswordHistoryManager::logPassword($user); - $user->update([ - 'password_expires_at' => now()->addDays(config('ae3auth-config.password_expires_in')) - ]); } /** @@ -25,8 +22,11 @@ class UserObserver public function created($user): void { PasswordHistoryManager::logNewPassword($user->id, $user->password); - $user->update([ - 'password_expires_at' => now()->addDays(config('ae3auth-config.password_expires_in')) - ]); + } + + public function creating($user): void + { + $expiresAtColumn = config('ae3auth-config.user.expires_password_column_name'); + $user->$expiresAtColumn = now()->addDays(config('ae3auth-config.password_expires_in')); } }