This commit is contained in:
ciomek committed 2026-09-04 17:31:30 +02:00
1 parent 5732e26380
commit dbed39ee3a
11 files changed
+122 -61

No files matched your search

+4 -1
View File
@@ -8,6 +8,7 @@ from starlette.authentication import (
)
from starlette.requests import HTTPConnection
from starlette.responses import JSONResponse, Response
from sqlalchemy.orm import selectinload
from sqlmodel import Session, select
from loon.web.db import engine
@@ -62,7 +63,9 @@ class JWTAuthBackend(AuthenticationBackend):
raise AuthenticationError("Invalid or expired token")
with Session(engine) as session:
user = session.exec(select(User).where(User.id == user_id)).first()
user = session.exec(
select(User).where(User.id == user_id).options(selectinload(User.minecraft_user))
).first()
if user is None:
raise AuthenticationError("User not found")