Override /login endpoint

For Blender Cloud we want to point directly to blender-id OAuth.
This commit is contained in:
2017-08-25 11:56:43 +02:00
parent 732fe7bc7c
commit 1fb3c88a8f

View File

@@ -4,7 +4,7 @@ import logging
from pillarsdk import Node, Project
from pillarsdk.exceptions import ResourceNotFound
from flask_login import current_user
from flask import Blueprint, current_app, render_template, redirect, url_for
from flask import Blueprint, current_app, render_template, redirect, session, url_for
from pillar.web.utils import system_util, get_file, current_user_is_authenticated
from pillar.web.utils import attach_project_pictures
@@ -86,6 +86,12 @@ def homepage():
api=api)
@blueprint.route('/login')
def login():
session['next_after_login'] = '/'
return redirect(url_for('users.oauth_authorize', provider='blender-id'))
@blueprint.route('/welcome')
def welcome():
# Workaround to cache rendering of a page if user not logged in