Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to catch exception or change the Scope not matched message #73

Open
simouel opened this issue Jul 7, 2022 · 0 comments
Open

How to catch exception or change the Scope not matched message #73

simouel opened this issue Jul 7, 2022 · 0 comments

Comments

@simouel
Copy link

simouel commented Jul 7, 2022

Hi,

Is it possible to catch the "Scope not matched" and display a more accurate message to the user.

`app.include_router(
manager.router,
prefix="/manager",
dependencies=[Depends(auth.scope('cognitogroup1))],
)
...
@router.get("/units")
def list_units(
current_user: AccessUser = Depends(auth.scope(['cognitogroup1']))
):
ret = [];
try:
print(current_user)
except:
raise

return "OK"

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant