diff --git a/platypush/backend/http/app/utils.py b/platypush/backend/http/app/utils.py index e79bf5cc..d435ee30 100644 --- a/platypush/backend/http/app/utils.py +++ b/platypush/backend/http/app/utils.py @@ -201,7 +201,7 @@ def authenticate(redirect_page='', skip_auth_methods=None, check_csrf_token=Fals if session_auth_ok: return f(*args, **kwargs) - return redirect('/login?redirect=' + redirect_page, 307) + return redirect('/login?redirect=' + (redirect_page or request.url), 307) # CSRF token check if check_csrf_token: