Skip to content

Commit 7ced58b

Browse files
authored
Merge pull request #13 from bullgom/feature/add-leeway-option
Feat: Add leeway option to ClerkConfig
2 parents 77937c0 + 00f8c40 commit 7ced58b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fastapi_clerk_auth/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class ClerkConfig(BaseModel):
2929
jwks_lifespan: int = 300
3030
jwks_headers: Optional[dict[str, Any]] = None
3131
jwks_client_timeout: int = 30
32+
leeway: int = 0
3233

3334

3435
class HTTPAuthorizationCredentials(FastAPIHTTPAuthorizationCredentials):
@@ -141,6 +142,7 @@ def _decode_token(self, token: str) -> dict | None:
141142
"verify_aud": self.config.verify_aud,
142143
"verify_iss": self.config.verify_iss,
143144
},
145+
leeway=self.config.leeway
144146
)
145147
return dict(jsonable_encoder(decoded_token))
146148
except Exception as e:

0 commit comments

Comments
 (0)