mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-10-29 16:36:56 +08:00
Fix typing of samesite paramater in CookieTransport
This commit is contained in:
@ -1,5 +1,11 @@
|
|||||||
|
import sys
|
||||||
from typing import Any, Optional
|
from typing import Any, Optional
|
||||||
|
|
||||||
|
if sys.version_info < (3, 8):
|
||||||
|
from typing_extensions import Literal # pragma: no cover
|
||||||
|
else:
|
||||||
|
from typing import Literal # pragma: no cover
|
||||||
|
|
||||||
from fastapi import Response, status
|
from fastapi import Response, status
|
||||||
from fastapi.security import APIKeyCookie
|
from fastapi.security import APIKeyCookie
|
||||||
|
|
||||||
@ -18,7 +24,7 @@ class CookieTransport(Transport):
|
|||||||
cookie_domain: Optional[str] = None,
|
cookie_domain: Optional[str] = None,
|
||||||
cookie_secure: bool = True,
|
cookie_secure: bool = True,
|
||||||
cookie_httponly: bool = True,
|
cookie_httponly: bool = True,
|
||||||
cookie_samesite: str = "lax",
|
cookie_samesite: Literal["lax", "strict", "none"] = "lax",
|
||||||
):
|
):
|
||||||
self.cookie_name = cookie_name
|
self.cookie_name = cookie_name
|
||||||
self.cookie_max_age = cookie_max_age
|
self.cookie_max_age = cookie_max_age
|
||||||
|
|||||||
Reference in New Issue
Block a user