When logging in from /welcome, redirect to index
Backend logic simplified, to support the next arg if provided, otherwise simply redirect to the request.referrer (last visited page).
This commit is contained in:
@@ -132,13 +132,8 @@ def login():
|
|||||||
|
|
||||||
next_after_login = request.args.get('next')
|
next_after_login = request.args.get('next')
|
||||||
|
|
||||||
# Redirect to /welcome if explicitly given, but not when falling back to the referrer.
|
|
||||||
if not next_after_login:
|
if not next_after_login:
|
||||||
url_for_welcome = url_for('cloud.welcome', _external=True)
|
next_after_login = request.referrer
|
||||||
if request.referrer == url_for_welcome:
|
|
||||||
next_after_login = '/'
|
|
||||||
else:
|
|
||||||
next_after_login = request.referrer
|
|
||||||
|
|
||||||
session['next_after_login'] = next_after_login
|
session['next_after_login'] = next_after_login
|
||||||
return redirect(url_for('users.oauth_authorize', provider='blender-id'))
|
return redirect(url_for('users.oauth_authorize', provider='blender-id'))
|
||||||
|
@@ -25,7 +25,7 @@ li
|
|||||||
|
|
||||||
| {% block navigation_user %}
|
| {% block navigation_user %}
|
||||||
li.nav-item-sign-in
|
li.nav-item-sign-in
|
||||||
a.navbar-item(href="{{ url_for('users.login') }}")
|
a.navbar-item(href="{{ url_for('users.login', next='/') }}")
|
||||||
| {% if current_user.is_anonymous %}
|
| {% if current_user.is_anonymous %}
|
||||||
| Log in and Explore
|
| Log in and Explore
|
||||||
| {% else %}
|
| {% else %}
|
||||||
|
Reference in New Issue
Block a user