Merge branch '#70' into #85

This commit is contained in:
2022-10-25 21:24:11 +02:00
2 changed files with 4 additions and 4 deletions

View File

@@ -349,7 +349,7 @@ class AuthService(AuthServiceABC):
raise ServiceException(ServiceErrorCode.InvalidUser, 'Wrong password')
# update password
if self._hash_sha256(update_user_dto.new_auth_user.password, user.password_salt) != user.password:
if update_user_dto.new_auth_user.password is not None and self._hash_sha256(update_user_dto.new_auth_user.password, user.password_salt) != user.password:
user.password_salt = uuid.uuid4()
user.password = self._hash_sha256(update_user_dto.new_auth_user.password, user.password_salt)
@@ -396,7 +396,7 @@ class AuthService(AuthServiceABC):
user.email = update_user_dto.new_auth_user.email
# update password
if update_user_dto.change_password and user.password != self._hash_sha256(update_user_dto.new_auth_user.password, user.password_salt):
if update_user_dto.new_auth_user.password is not None and update_user_dto.change_password and user.password != self._hash_sha256(update_user_dto.new_auth_user.password, user.password_salt):
user.password_salt = uuid.uuid4()
user.password = self._hash_sha256(update_user_dto.new_auth_user.password, user.password_salt)