FIX: Redirect to /login-preferences didn't work for subfolders

This commit is contained in:
Gerhard Schlager 2019-12-05 22:34:42 +01:00
parent 895d5cb592
commit 86186de1e3
1 changed files with 2 additions and 2 deletions

View File

@ -238,8 +238,8 @@ class UsersController < ApplicationController
raise Discourse::NotFound if params[:path] !~ /^[a-z_\-\/]+$/
if current_user.blank?
cookies[:destination_url] = "/my/#{params[:path]}"
redirect_to "/login-preferences"
cookies[:destination_url] = path("/my/#{params[:path]}")
redirect_to path("/login-preferences")
else
redirect_to(path("/u/#{current_user.username}/#{params[:path]}"))
end