# HG changeset patch # User Sylvain Thénault # Date 1458317623 -3600 # Node ID cc1d4b66ca263b33535f8a12b37d2f97a2d79f4b # Parent 259fa3391c7bb57ff4ba94c5361cb73ad223cc70 [login] fix the redirect url after login (closes #11689118) redirecting to '/' by default after login doesn't work properly when a prefix is used, whether we're sitting behind a PrefixMiddleware or not. To fix this, rely on cubicweb's build_url to turn any relative path into an absolute url. diff -r 259fa3391c7b -r cc1d4b66ca26 pyramid_cubicweb/login.py --- a/pyramid_cubicweb/login.py Tue Mar 08 16:12:01 2016 +0100 +++ b/pyramid_cubicweb/login.py Fri Mar 18 17:13:43 2016 +0100 @@ -57,12 +57,13 @@ request, user_eid, persistent=asbool(request.params.get('__setauthcookie', False))) - new_path = request.params.get('postlogin_path', '/') + new_path = request.params.get('postlogin_path', '') if new_path == 'login': - new_path = '/' + new_path = '' - raise HTTPSeeOther(new_path, headers=headers) + url = request.cw_request.build_url(new_path) + raise HTTPSeeOther(url, headers=headers) @view_config(route_name='login', effective_principals=security.Authenticated)