Skip to content

Commit 90b9253

Browse files
committed
Fix #47 - Don't cache access_token
1 parent 53973d6 commit 90b9253

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/fastapi_oauth2/core.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ class OAuth2Core:
5454
_oauth_client: Optional[WebApplicationClient] = None
5555
_authorization_endpoint: str = None
5656
_token_endpoint: str = None
57-
_access_token: str = None
5857
_state: str = None
5958

6059
def __init__(self, client: OAuth2Client) -> None:
@@ -71,9 +70,7 @@ def __init__(self, client: OAuth2Client) -> None:
7170

7271
@property
7372
def access_token(self) -> str:
74-
if not self._access_token:
75-
self._access_token = self._oauth_client.access_token
76-
return self._access_token
73+
return self._oauth_client.access_token
7774

7875
def get_redirect_uri(self, request: Request) -> str:
7976
return urljoin(str(request.base_url), "/oauth2/%s/token" % self.provider)

0 commit comments

Comments
 (0)