fix: always update password on re-registration in /user/create

When Evotor sends a new /user/create for an existing userId, the new
password should replace the old one so /user/verify stays in sync.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-05-24 17:43:05 +03:00
parent 41280fad45
commit cd777d2bc1

View File

@@ -141,7 +141,7 @@ async def user_create(request: Request, db: Session = Depends(get_db)):
user.last_name = last_name
if middle_name:
user.middle_name = middle_name
if password and not user.password_hash:
if password:
user.password_hash = hash_password(password)
if user.status == UserStatusEnum.pending:
user.status = UserStatusEnum.active