FEATURE: simpler and friendlier unsubscribe workflow

- All unsubscribes go to the exact same page
- You may unsubscribe from watching a category on that page
- You no longer need to be logged in to unsubscribe from a topic
- Simplified footer on emails
This commit is contained in:
Sam
2016-06-17 11:27:52 +10:00
parent 78818551ef
commit 852860de66
18 changed files with 499 additions and 234 deletions

View File

@ -4,7 +4,7 @@ require_dependency 'single_sign_on'
class SessionController < ApplicationController
skip_before_filter :redirect_to_login_if_required
skip_before_filter :preload_json, :check_xhr, only: ['sso', 'sso_login', 'become', 'sso_provider']
skip_before_filter :preload_json, :check_xhr, only: ['sso', 'sso_login', 'become', 'sso_provider', 'destroy']
def csrf
render json: {csrf: form_authenticity_token }
@ -237,7 +237,11 @@ class SessionController < ApplicationController
def destroy
reset_session
log_off_user
render nothing: true
if request.xhr?
render nothing: true
else
redirect_to (params[:return_url] || path("/"))
end
end
private