mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: /my/preferences
should prompt users to log in
This commit is contained in:
@ -162,11 +162,15 @@ class UsersController < ApplicationController
|
||||
end
|
||||
|
||||
def my_redirect
|
||||
if current_user.present? && params[:path] =~ /^[a-z\-\/]+$/
|
||||
redirect_to path("/users/#{current_user.username}/#{params[:path]}")
|
||||
return
|
||||
|
||||
raise Discourse::NotFound if params[:path] !~ /^[a-z\-\/]+$/
|
||||
|
||||
if current_user.blank?
|
||||
cookies[:destination_url] = "/my/#{params[:path]}"
|
||||
redirect_to :login
|
||||
else
|
||||
redirect_to(path("/users/#{current_user.username}/#{params[:path]}"))
|
||||
end
|
||||
raise Discourse::NotFound
|
||||
end
|
||||
|
||||
def invited
|
||||
|
Reference in New Issue
Block a user