We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
access_token
1 parent 3edfeb8 commit e0ca1d4Copy full SHA for e0ca1d4
src/fastapi_oauth2/core.py
@@ -54,6 +54,7 @@ class OAuth2Core:
54
_oauth_client: Optional[WebApplicationClient] = None
55
_authorization_endpoint: str = None
56
_token_endpoint: str = None
57
+ _access_token: str = None
58
_state: str = None
59
60
def __init__(self, client: OAuth2Client) -> None:
@@ -70,7 +71,9 @@ def __init__(self, client: OAuth2Client) -> None:
70
71
72
@property
73
def access_token(self) -> str:
- return self._oauth_client.access_token
74
+ if not self._access_token:
75
+ self._access_token = self._oauth_client.access_token
76
+ return self._access_token
77
78
def get_redirect_uri(self, request: Request) -> str:
79
return urljoin(str(request.base_url), "/oauth2/%s/token" % self.provider)
0 commit comments