diff --git a/locker_server/api_orm/repositories/user_repository.py b/locker_server/api_orm/repositories/user_repository.py index c59ceff..a8e4a95 100644 --- a/locker_server/api_orm/repositories/user_repository.py +++ b/locker_server/api_orm/repositories/user_repository.py @@ -569,7 +569,8 @@ def retrieve_or_create_by_id(self, user_id, creation_date=None) -> Tuple[User, b creation_date = now() if not creation_date else float(creation_date) user_orm, is_created = UserORM.objects.get_or_create(user_id=user_id, defaults={ "user_id": user_id, - "creation_date": creation_date + "creation_date": creation_date, + "is_password_changed": False }) return ModelParser.user_parser().parse_user(user_orm=user_orm), is_created @@ -578,7 +579,8 @@ def retrieve_or_create_by_email(self, email: str, creation_date=None) -> Tuple[U user_orm, is_created = UserORM.objects.get_or_create(email=email, defaults={ "email": email, "full_name": email, - "creation_date": creation_date + "creation_date": creation_date, + "is_password_changed": False }) return ModelParser.user_parser().parse_user(user_orm=user_orm), is_created diff --git a/locker_server/core/services/user_service.py b/locker_server/core/services/user_service.py index 5115eb4..13d002b 100644 --- a/locker_server/core/services/user_service.py +++ b/locker_server/core/services/user_service.py @@ -940,7 +940,7 @@ def user_session_by_otp(self, user: User, password: str, method: str, otp_code: if save_device: # Save device to device factor2 white list device_factor2_create_data = { - "device_id": device_existed.device_id, + "device_id": device_obj.device_id, "factor2_method_id": factor2_method.factor2_method_id } self.device_factor2_repository.create_device_factor2(