No SQLModel

This commit is contained in:
ciomek committed 2026-09-04 23:41:35 +02:00
1 parent 5f0e8c11b4
commit 9964fbf044
16 files changed
+91 -84

No files matched your search

+4 -4
View File
@@ -8,8 +8,8 @@ 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 sqlalchemy.orm import selectinload, Session
from sqlalchemy import select
from loon.web.db import engine
from loon.web.users.models import User
@@ -63,9 +63,9 @@ class JWTAuthBackend(AuthenticationBackend):
raise AuthenticationError("Invalid or expired token")
with Session(engine) as session:
user = session.exec(
user = session.execute(
select(User).where(User.id == user_id).options(selectinload(User.minecraft_user))
).first()
).scalars().first()
if user is None:
raise AuthenticationError("User not found")