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

Stateless OAuth2 client #270

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions flask_oauthlib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ def authorize(self, callback=None, state=None, **kwargs):
# state can be function for generate a random string
state = state()

session['%s_oauthredir' % self.name] = callback
url = client.prepare_request_uri(
self.expand_url(self.authorize_url),
redirect_uri=callback,
Expand Down Expand Up @@ -618,12 +617,10 @@ def handle_oauth1_response(self):

def handle_oauth2_response(self):
"""Handles an oauth2 authorization response."""

client = self.make_client()
remote_args = {
'code': request.args.get('code'),
'client_secret': self.consumer_secret,
'redirect_uri': session.get('%s_oauthredir' % self.name)
}
log.debug('Prepare oauth2 remote args %r', remote_args)
remote_args.update(self.access_token_params)
Expand Down Expand Up @@ -672,7 +669,6 @@ def authorized_response(self):

# free request token
session.pop('%s_oauthtok' % self.name, None)
session.pop('%s_oauthredir' % self.name, None)
return data

def authorized_handler(self, f):
Expand Down