Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in 'flask.client.oauth.RemoteApp' token property #94

Closed
pawelad opened this issue Oct 5, 2018 · 0 comments
Closed

Typo in 'flask.client.oauth.RemoteApp' token property #94

pawelad opened this issue Oct 5, 2018 · 0 comments

Comments

@pawelad
Copy link

pawelad commented Oct 5, 2018

Hi - I'm pretty sure I found a bug while debugging #81.
The flask.client.oauth.RemoteApp.token property setter and getter are tying to access a different path:

@property
def token(self):
ctx = _app_ctx_stack.top
attr = 'authlib_client_oauth_token_{}'.format(self.name)
token = getattr(ctx, attr, None)
if token:
return token
if self._fetch_token:
token = self._fetch_token()
self.token = token
return token
@token.setter
def token(self, token):
ctx = _app_ctx_stack.top
attr = 'authlib_oauth_token_{}'.format(self.name)
setattr(ctx, attr, token)

Notice the attr being different, authlib_client_oauth_token_{} vs authlib_oauth_token_{}. That means even if you set the token via self.token = token, accessing self.token returns None.

@lepture lepture closed this as completed in 47e3b6a Oct 7, 2018
coopfeathy added a commit to coopfeathy/authlib-django that referenced this issue Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant