Skip to content

Commit

Permalink
Fix github api first get missing access token
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Jul 4, 2018
1 parent 34a902e commit 29e9afe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions demos/github-login/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ def authorized(access_token):
flash('Login failed.')
return redirect(url_for('index'))

response = github.get('user')
username = response['login']
response = github.get('user', access_token=access_token)
username = response['login'] # get username
user = User.query.filter_by(username=username).first()
if user is None:
user = User(username=username, access_token=access_token)
Expand Down

0 comments on commit 29e9afe

Please sign in to comment.