Fix id token get endpoint
All checks were successful
ci/woodpecker/push/docker Pipeline was successful
All checks were successful
ci/woodpecker/push/docker Pipeline was successful
This commit is contained in:
parent
65183e26c0
commit
486977f828
2 changed files with 2 additions and 1 deletions
|
@ -28,6 +28,7 @@ def create_ocpp_app():
|
||||||
def create_app():
|
def create_app():
|
||||||
app = FastAPI(
|
app = FastAPI(
|
||||||
title="simple-ocpp-cs",
|
title="simple-ocpp-cs",
|
||||||
|
version="0.2.0",
|
||||||
summary="Simple implementation of a basic OCPP 2.0.1 compliant central system (backend) for EV charging stations",
|
summary="Simple implementation of a basic OCPP 2.0.1 compliant central system (backend) for EV charging stations",
|
||||||
responses={404: {"description": "Not found"}},
|
responses={404: {"description": "Not found"}},
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,7 +24,7 @@ async def get_id_tokens(
|
||||||
db: Session = Depends(get_db),
|
db: Session = Depends(get_db),
|
||||||
token: AccessToken = Depends(JWTBearer()),
|
token: AccessToken = Depends(JWTBearer()),
|
||||||
):
|
):
|
||||||
stmt = select(Session)
|
stmt = select(DbIdToken)
|
||||||
if token.role != Role.ADMINISTRATOR:
|
if token.role != Role.ADMINISTRATOR:
|
||||||
stmt = stmt.where(DbIdToken.owner_id == token.subject)
|
stmt = stmt.where(DbIdToken.owner_id == token.subject)
|
||||||
stmt = stmt.order_by(DbIdToken.id).offset(skip).limit(limit)
|
stmt = stmt.order_by(DbIdToken.id).offset(skip).limit(limit)
|
||||||
|
|
Loading…
Add table
Reference in a new issue