Spaces:
Running
Running
vanitha commited on
Commit ·
e642846
1
Parent(s): 1bb0782
(System_user)-updated last_login_at in change_password()
Browse files
app/system_users/services/service.py
CHANGED
|
@@ -628,7 +628,7 @@ class SystemUserService:
|
|
| 628 |
|
| 629 |
# Hash new password
|
| 630 |
new_password_hash = self.get_password_hash(new_password)
|
| 631 |
-
|
| 632 |
# Update password
|
| 633 |
await self.collection.update_one(
|
| 634 |
{"user_id": str(user_id)},
|
|
@@ -636,6 +636,7 @@ class SystemUserService:
|
|
| 636 |
"password_hash": new_password_hash,
|
| 637 |
"security_settings.last_password_change": datetime.utcnow(),
|
| 638 |
"security_settings.require_password_change": False,
|
|
|
|
| 639 |
"updated_at": datetime.utcnow()
|
| 640 |
}}
|
| 641 |
)
|
|
|
|
| 628 |
|
| 629 |
# Hash new password
|
| 630 |
new_password_hash = self.get_password_hash(new_password)
|
| 631 |
+
now = datetime.utcnow()
|
| 632 |
# Update password
|
| 633 |
await self.collection.update_one(
|
| 634 |
{"user_id": str(user_id)},
|
|
|
|
| 636 |
"password_hash": new_password_hash,
|
| 637 |
"security_settings.last_password_change": datetime.utcnow(),
|
| 638 |
"security_settings.require_password_change": False,
|
| 639 |
+
"last_login_at": now,
|
| 640 |
"updated_at": datetime.utcnow()
|
| 641 |
}}
|
| 642 |
)
|