Skip to content

Commit

Permalink
fix: snake_case
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought committed Apr 6, 2024
1 parent 8b94d70 commit a56a0df
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
secret_key = "SuperSecret"


def generate_auth_token(userId, admin):
def generate_auth_token(user_id, admin):
payload = {
"email": userId,
"email": user_id,
"admin": admin,
"exp": datetime.now(tz=timezone.utc) + timedelta(hours=24),
}
Expand Down Expand Up @@ -42,8 +42,8 @@ def requires_authentication(req: Request):
raise HTTPException(status_code=403, detail="Unauthorized")

# verify token is good if provided
userInfo = authenticate_token(req.headers["authorization"])
if not userInfo or not userInfo.get("admin"):
user_info = authenticate_token(req.headers["authorization"])
if not user_info or not user_info.get("admin"):
log.error("Unauthorized User")
raise HTTPException(status_code=403, detail="Unauthorized")
else:
Expand Down

0 comments on commit a56a0df

Please sign in to comment.