Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
marcvs committed Dec 5, 2023
1 parent 111acc6 commit 01d90da
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/example_fastapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ def authenticated(

# -------------------------------------------------------------------
# Instead of giving an error this will return the custom error
# response from `my_on_failure` -------------------------------------
def my_on_failure(exception, user_infos=None):
return "Custom callback 'my_on_failure' invoked"
# response from `my_own_failure` -------------------------------------
def my_own_failure(exception, user_infos=None):
return "Custom callback 'my_own_failure' invoked"


@app.get("/authenticated_callback")
@flaat.is_authenticated(on_failure=my_on_failure)
@flaat.is_authenticated(on_failure=my_own_failure)
def authenticated_callback(
request: Request,
credentials: HTTPBasicCredentials = Depends(security),
Expand Down Expand Up @@ -184,7 +184,7 @@ def my_process_args(user_infos, *args, **kwargs):
user_requirements=get_claim_requirement("bar", "foo"),
request_requirements=my_request_check,
process_arguments=my_process_args,
on_failure=my_on_failure,
on_failure=my_own_failure,
ignore_no_authn=True, # Don't fail if there is no authentication
)

Expand Down

0 comments on commit 01d90da

Please sign in to comment.