INNER CODE UNIT · Python
_get_csrf_token
IndominusByte/fastapi-jwt-auth · fastapi_jwt_auth/auth_jwt.py:307
def _get_csrf_token(self,encoded_token: str) -> str:
"""
Returns the CSRF double submit token from an encoded JWT.
:param encoded_token: The encoded JWT
:return: The CSRF double submit token
"""
return self._verified_token(encoded_token)['csrf']
def set_access_cookies(
self,
encoded_access_token: str,
response: Optional[Response] = None,
max_age: Optional[int] = None
) -> None:
"""
Configures the response to set access token in a cookie.
this will also set the CSRF double submit values in a separate cookie