Skip to content

Commit 2183f9a

Browse files
committed
refactor: correct logging style
1 parent e13a89d commit 2183f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/stac_auth_proxy/middleware/EnforceAuthMiddleware.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def validate_token(
130130
# Extract token from header
131131
token_parts = auth_header.split(" ")
132132
if len(token_parts) != 2 or token_parts[0].lower() != "bearer":
133-
logger.error(f"Invalid token: {auth_header}")
133+
logger.error("Invalid token: %r", auth_header)
134134
raise HTTPException(
135135
status_code=status.HTTP_401_UNAUTHORIZED,
136136
detail="Could not validate credentials",
@@ -149,7 +149,7 @@ def validate_token(
149149
audience=self.allowed_jwt_audiences,
150150
)
151151
except (jwt.exceptions.InvalidTokenError, jwt.exceptions.DecodeError) as e:
152-
logger.exception(f"InvalidTokenError: {e=}")
152+
logger.error("InvalidTokenError: %r", e)
153153
raise HTTPException(
154154
status_code=status.HTTP_401_UNAUTHORIZED,
155155
detail="Could not validate credentials",

0 commit comments

Comments
 (0)