INNER CODE UNIT · Python
_unset_cookies
yezz123/authx · authx/main.py:276
def _unset_cookies(
self,
type: str,
response: Response,
) -> None:
if type == "access":
token_key = self.config.JWT_ACCESS_COOKIE_NAME
token_path = self.config.JWT_ACCESS_COOKIE_PATH
csrf_key = self.config.JWT_ACCESS_CSRF_COOKIE_NAME
csrf_path = self.config.JWT_ACCESS_CSRF_COOKIE_PATH
elif type == "refresh":
token_key = self.config.JWT_REFRESH_COOKIE_NAME
token_path = self.config.JWT_REFRESH_COOKIE_PATH
csrf_key = self.config.JWT_REFRESH_CSRF_COOKIE_NAME
csrf_path = self.config.JWT_REFRESH_CSRF_COOKIE_PATH
else:
raise ValueError("Token type must be 'access' | 'refresh'")
# Unset cookie