mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-14 18:58:13 +08:00
Make get_current_admin
error to 401
and add 401
error page.
This commit is contained in:
@ -54,3 +54,9 @@ async def forbidden_error_exception(request: Request, exc: HTTPException):
|
||||
return templates.TemplateResponse(
|
||||
"errors/403.html", status_code=exc.status_code, context={"request": request}
|
||||
)
|
||||
|
||||
|
||||
async def unauthorized_error_exception(request: Request, exc: HTTPException):
|
||||
return templates.TemplateResponse(
|
||||
"errors/401.html", status_code=exc.status_code, context={"request": request}
|
||||
)
|
||||
|
Reference in New Issue
Block a user