Jwt¶
jwt
¶
JWT token creation and validation.
Provides functions for creating and decoding JWT access tokens using the python-jose library.
Classes¶
TokenError
¶
Bases: Exception
Raised when a token is invalid or expired.
Functions¶
create_access_token
¶
create_access_token(
*,
subject: str,
expires_delta: timedelta | None = None,
extra_claims: dict[str, Any] | None = None
) -> str
Create a JWT access token.
subject: usually user.id
Source code in fastauth/security/jwt.py
decode_access_token
¶
Decode and validate a JWT access token.