Skip to content

Commit

Permalink
Rename bearer auth decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
markhobson committed Oct 25, 2023
1 parent a06ae8f commit 15399e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion schemes/auth/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def logout() -> BaseResponse:
P = ParamSpec("P")


def secure(func: Callable[P, T]) -> Callable[P, T | Response]:
def bearer_auth(func: Callable[P, T]) -> Callable[P, T | Response]:
@wraps(func)
def decorated_function(*args: P.args, **kwargs: P.kwargs) -> T | Response:
if "user" not in session:
Expand Down
4 changes: 2 additions & 2 deletions schemes/home.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from flask import Blueprint, render_template

from schemes.auth import secure
from schemes.auth import bearer_auth

bp = Blueprint("home", __name__)


@bp.get("")
@secure
@bearer_auth
def index() -> str:
return render_template("home.html")

0 comments on commit 15399e4

Please sign in to comment.