From 1fb3c88a8f3207e119955ddae7ae8a041369cb01 Mon Sep 17 00:00:00 2001 From: Francesco Siddi Date: Fri, 25 Aug 2017 11:56:43 +0200 Subject: [PATCH] Override /login endpoint For Blender Cloud we want to point directly to blender-id OAuth. --- cloud/routes.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloud/routes.py b/cloud/routes.py index 458d7b7..9013c73 100644 --- a/cloud/routes.py +++ b/cloud/routes.py @@ -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