fastapi-cloudauth
fastapi-cloudauth copied to clipboard
How to catch exception or change the Scope not matched message
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"
`