INNER CODE UNIT · Python
_get_expired_time
IndominusByte/fastapi-jwt-auth · fastapi_jwt_auth/auth_jwt.py:219
def _get_expired_time(
self,
type_token: str,
expires_time: Optional[Union[timedelta,int,bool]] = None
) -> Union[None,int]:
"""
Dynamic token expired, if expires_time is False exp claim not created
:param type_token: indicate token is access_token or refresh_token
:param expires_time: duration expired jwt
:return: duration exp claim jwt
"""
if expires_time and not isinstance(expires_time, (timedelta,int,bool)):
raise TypeError("expires_time must be between timedelta, int, bool")
if expires_time is not False:
if type_token == 'access':