diff options
author | ThibG <thib@sitedethib.com> | 2018-09-11 20:09:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-11 20:09:00 +0200 |
commit | 82b521b4c306d75530795bce9f6c706359e7339e (patch) | |
tree | 4ac730d5c48dfd27703e33ffab034e3266f7e0ad /app/controllers/auth/sessions_controller.rb | |
parent | 59de2868c13a61bce08923f841024fefebe3b3da (diff) | |
parent | f1214f00d990612229c753d8657944a10b9bf8a1 (diff) |
Merge pull request #724 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/controllers/auth/sessions_controller.rb')
-rw-r--r-- | app/controllers/auth/sessions_controller.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index 7cd46662f..f4401b3dd 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -11,6 +11,7 @@ class Auth::SessionsController < Devise::SessionsController prepend_before_action :set_pack before_action :set_instance_presenter, only: [:new] before_action :set_body_classes + after_action :clear_site_data, only: [:destroy] def new Devise.omniauth_configs.each do |provider, config| @@ -28,8 +29,10 @@ class Auth::SessionsController < Devise::SessionsController end def destroy + tmp_stored_location = stored_location_for(:user) super flash.delete(:notice) + store_location_for(:user, tmp_stored_location) if continue_after? end protected @@ -126,4 +129,16 @@ class Auth::SessionsController < Devise::SessionsController end paths end + + def clear_site_data + return if continue_after? + + # Should be '"*"' but that doen't work in Chrome (neither does '"executionContexts"') + # https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data + response.headers['Clear-Site-Data'] = '"cache", "cookies"' + end + + def continue_after? + truthy_param?(:continue) + end end |