Skip to content

feat(auth): add requires_{auth,guest} decorators

Kevin Morris requested to merge kevr/aurweb:simplify-auth-dec into pu

These new decorators are meant to be used without any arguments and provide aliases to auth_required:

  • auth_required(True) -> requires_auth
  • auth_required(False) -> requires_guest

These decorators should be used without arguments, e.g.:

@router.get("/")
@requires_guest
async def my_route(request: Request):
    return HTMLResponse()

Signed-off-by: Kevin Morris kevr@0cost.org

Merge request reports