enable oauth, set correct default oauth success endpoint

This commit is contained in:
Matthew Scragg 2015-10-20 17:18:43 -05:00
parent a0124baf1d
commit 4fede50136
2 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,4 @@
from flask import Blueprint, url_for, request, flash, redirect, session
from flask import Blueprint, url_for, request, flash, redirect, session, current_app
from .models import User
blueprint = Blueprint('auth.oauth', __name__)
@ -16,7 +16,7 @@ def login(provider):
@blueprint.route('/login/oauth/<provider>/callback')
def callback(provider):
next_url = request.args.get('next') or url_for('index')
next_url = request.args.get('next') or current_app.config['ROOT_ENDPOINT']
try:
resp = User.get_app(provider).authorized_response()
if resp is None: