Handle some of the error cases with github login.
This commit is contained in:
parent
bb5fea6a5f
commit
87ff939ad2
5 changed files with 86 additions and 24 deletions
|
@ -135,14 +135,18 @@ def github_oauth_callback():
|
|||
to_login = model.verify_federated_login('github', github_id)
|
||||
if not to_login:
|
||||
# try to create the user
|
||||
to_login = model.create_federated_user(username, found_email, 'github',
|
||||
github_id)
|
||||
|
||||
try:
|
||||
to_login = model.create_federated_user(username, found_email, 'github',
|
||||
github_id)
|
||||
except model.DataModelException, ex:
|
||||
return render_template('githuberror.html', error_message=ex.message)
|
||||
|
||||
if common_login(to_login):
|
||||
return redirect(url_for('index'))
|
||||
|
||||
# TODO something bad happened, we need to tell the user somehow
|
||||
return redirect(url_for('signin'))
|
||||
return render_template('githuberror.html')
|
||||
|
||||
|
||||
@app.route('/confirm', methods=['GET'])
|
||||
|
|
Reference in a new issue