This commit is contained in:
ciomek committed 2026-09-04 17:02:25 +02:00
1 parent c500c3fadf
commit 5732e26380
10 files changed
+176 -2

No files matched your search

@@ -4,6 +4,8 @@ from sqlalchemy.exc import IntegrityError
from sqlmodel import Session, select
from loon.web.db import engine
from loon.web.logs.service import write_log
from loon.web.logs.types import LogTypeEnum
from loon.web.users.models import User
@@ -34,6 +36,7 @@ async def change_password_handler(client, userdata, msg, data):
select(User).where(User.uuid == uuid)
).first()
user.password = password
internal_username = user.internal_username
try:
session.commit()
@@ -44,4 +47,6 @@ async def change_password_handler(client, userdata, msg, data):
return
await write_log(LogTypeEnum.PLAYER_PASSWORD_CHANGED, f"Player {internal_username} ({uuid}) changed their password.")
client.publish(f"loon/auth/change_password/{uuid}/response", json.dumps({"success": True, "error": None}))