feat(auth): implement JWT TTL and expiration
added access_token_ttl setting fixed public and private key mismatch while decoding jwt decode_jwt now returns None on expired tokens instead of raising exc generate_pair converts sub to string and uses dynamic expiration
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
from datetime import UTC, datetime
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from core.exp import get_exp
|
||||
from schemas.providers import ProvidersType
|
||||
|
||||
|
||||
class JWTPayload(BaseModel):
|
||||
sub: int = Field(description="User ID")
|
||||
sub: str = Field(description="User ID")
|
||||
iss: ProvidersType = Field(description="Issuer")
|
||||
exp: float = Field(default_factory=lambda: datetime.now(UTC).timestamp())
|
||||
exp: float = Field(default_factory=get_exp)
|
||||
|
||||
Reference in New Issue
Block a user