Override /login endpoint
For Blender Cloud we want to point directly to blender-id OAuth.
This commit is contained in:
@@ -4,7 +4,7 @@ import logging
|
|||||||
from pillarsdk import Node, Project
|
from pillarsdk import Node, Project
|
||||||
from pillarsdk.exceptions import ResourceNotFound
|
from pillarsdk.exceptions import ResourceNotFound
|
||||||
from flask_login import current_user
|
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 system_util, get_file, current_user_is_authenticated
|
||||||
from pillar.web.utils import attach_project_pictures
|
from pillar.web.utils import attach_project_pictures
|
||||||
|
|
||||||
@@ -86,6 +86,12 @@ def homepage():
|
|||||||
api=api)
|
api=api)
|
||||||
|
|
||||||
|
|
||||||
|
@blueprint.route('/login')
|
||||||
|
def login():
|
||||||
|
session['next_after_login'] = '/'
|
||||||
|
return redirect(url_for('users.oauth_authorize', provider='blender-id'))
|
||||||
|
|
||||||
|
|
||||||
@blueprint.route('/welcome')
|
@blueprint.route('/welcome')
|
||||||
def welcome():
|
def welcome():
|
||||||
# Workaround to cache rendering of a page if user not logged in
|
# Workaround to cache rendering of a page if user not logged in
|
||||||
|
Reference in New Issue
Block a user