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
8 lines
203 B
Python
8 lines
203 B
Python
from datetime import UTC, datetime, timedelta
|
|
|
|
from config import cfg
|
|
|
|
|
|
def get_exp(minutes: int = cfg.access_token_ttl) -> float:
|
|
return (datetime.now(UTC) + timedelta(minutes=minutes)).timestamp()
|