diff --git a/cloud/routes.py b/cloud/routes.py index 46e7c1c..333b557 100644 --- a/cloud/routes.py +++ b/cloud/routes.py @@ -132,13 +132,8 @@ def login(): 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: - url_for_welcome = url_for('cloud.welcome', _external=True) - if request.referrer == url_for_welcome: - next_after_login = '/' - else: - next_after_login = request.referrer + next_after_login = request.referrer session['next_after_login'] = next_after_login return redirect(url_for('users.oauth_authorize', provider='blender-id')) diff --git a/src/templates/welcome.pug b/src/templates/welcome.pug index 700203e..6d4fd63 100644 --- a/src/templates/welcome.pug +++ b/src/templates/welcome.pug @@ -25,7 +25,7 @@ li | {% block navigation_user %} 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 %} | Log in and Explore | {% else %}