mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
UX: show login screen when anon tries to unsubscribe topic
This commit is contained in:
parent
42bf8151b2
commit
6243a7ad07
1 changed files with 6 additions and 2 deletions
|
@ -25,8 +25,7 @@ class TopicsController < ApplicationController
|
||||||
:reset_new,
|
:reset_new,
|
||||||
:change_post_owners,
|
:change_post_owners,
|
||||||
:change_timestamps,
|
:change_timestamps,
|
||||||
:bookmark,
|
:bookmark]
|
||||||
:unsubscribe]
|
|
||||||
|
|
||||||
before_filter :consider_user_for_promotion, only: :show
|
before_filter :consider_user_for_promotion, only: :show
|
||||||
|
|
||||||
|
@ -103,6 +102,11 @@ class TopicsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def unsubscribe
|
def unsubscribe
|
||||||
|
if current_user.blank?
|
||||||
|
cookies[:destination_url] = request.fullpath
|
||||||
|
return redirect_to "/login-preferences"
|
||||||
|
end
|
||||||
|
|
||||||
@topic_view = TopicView.new(params[:topic_id], current_user)
|
@topic_view = TopicView.new(params[:topic_id], current_user)
|
||||||
|
|
||||||
if slugs_do_not_match || (!request.format.json? && params[:slug].blank?)
|
if slugs_do_not_match || (!request.format.json? && params[:slug].blank?)
|
||||||
|
|
Loading…
Reference in a new issue