Created
May 23, 2016 06:12
-
-
Save toughrogrammer/b353a7568884b993e0361e29f2b395cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/oauth/login', methods=['GET']) | |
def oauth_login(): | |
form_data = { | |
'code': request.args['code'], | |
'redirect_uri': url_for('oauth_login', _external=True), | |
'grant_type': 'authorization_code', | |
'client_id': app.config.get('OAUTH_CLIENT_ID'), | |
'client_secret': app.config.get('OAUTH_CLIENT_SECRET'), | |
'scope': 'god' | |
} | |
response = RequestOauth.get_token(form_data) | |
oauth_access_token = response['access_token'] | |
oauth_refresh_token = response['refresh_token'] | |
params = parse_qs(urlparse(request.referrer).query) | |
next_url = params['next'][0] if 'next' in params else url_for('root') | |
response = make_response(render_template('jump.html', next=next_url)) | |
return response |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment