Open amitrahav opened 3 years ago
I had the same issue and i found this workaround:
def get_current_user(
current_user: AccessUser = Depends(auth.claim(AccessUser)),
):
return current_user
def get_read_scopes(
scopes=Depends(auth.scope(["admin:read"])),
):
return scopes
And then in the route
@r.get(
"/test",
responses={404: {"description": "Not found"}},
dependencies=[Depends(get_read_scopes)],
)
def get_contact_moment(
current_user: AccessUser = Depends(get_current_user),
):
and then use app.dependency_overrides
Request: adding documentation of mocking auth for tests.
I tried:
Yet, getting 403 with details: "Not authenticated"