diff --git a/realms/modules/auth/models.py b/realms/modules/auth/models.py index ba9ccd7..a75aa50 100644 --- a/realms/modules/auth/models.py +++ b/realms/modules/auth/models.py @@ -31,7 +31,7 @@ class Auth(object): def login_forms(): forms = [] # TODO be dynamic - for t in ['local', 'ldap']: + for t in ['local', 'ldap', 'oauth']: forms.append(Auth.get_auth_user(t).login_form()) return forms diff --git a/realms/modules/auth/oauth/views.py b/realms/modules/auth/oauth/views.py index b51c60c..9c52cf4 100644 --- a/realms/modules/auth/oauth/views.py +++ b/realms/modules/auth/oauth/views.py @@ -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//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: