mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: safecheck code
This commit is contained in:
parent
4b623ae1b8
commit
977008f0ae
21 changed files with 234 additions and 151 deletions
8
app.py
8
app.py
|
|
@ -11,7 +11,7 @@ from fastapi_jwt_auth.exceptions import AuthJWTException
|
|||
# (c) LearnHouse 2022
|
||||
########################
|
||||
|
||||
#
|
||||
|
||||
# Global Config
|
||||
app = FastAPI(
|
||||
title="LearnHouse",
|
||||
|
|
@ -28,13 +28,13 @@ app.add_middleware(
|
|||
allow_headers=["*"]
|
||||
)
|
||||
|
||||
#
|
||||
|
||||
# Exception Handler
|
||||
@app.exception_handler(AuthJWTException)
|
||||
def authjwt_exception_handler(request: Request, exc: AuthJWTException):
|
||||
return JSONResponse(
|
||||
status_code=exc.status_code,
|
||||
content={"detail": exc.message}
|
||||
status_code=exc.status_code, # type: ignore
|
||||
content={"detail": exc.message} # type: ignore
|
||||
)
|
||||
|
||||
app.include_router(global_router)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue