From 4fede50136316d34d835912a944d13e681de6af0 Mon Sep 17 00:00:00 2001 From: Matthew Scragg Date: Tue, 20 Oct 2015 17:18:43 -0500 Subject: [PATCH] enable oauth, set correct default oauth success endpoint --- realms/modules/auth/models.py | 2 +- realms/modules/auth/oauth/views.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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: