diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-08-06 23:07:08 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-08-07 01:08:31 -0500 |
commit | d9a8c50f9279a40c42ed9a8d3f4c8f11313046e2 (patch) | |
tree | 8c155bd39eaf941650b42cef24353a463a3d162d /app | |
parent | ff22f11aae1cb895f80931510ac1c3a7690c34e2 (diff) |
remember login & clear signed-in notice when switching accounts
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/auth/sessions_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/auth/sessions_controller.rb b/app/controllers/auth/sessions_controller.rb index 413962607..0b291e231 100644 --- a/app/controllers/auth/sessions_controller.rb +++ b/app/controllers/auth/sessions_controller.rb @@ -117,7 +117,11 @@ class Auth::SessionsController < Devise::SessionsController target_user = User.find_by(id: switch_params[:switch_to]) return unless target_user.present? && current_user.in?(target_user.linked_users) self.resource = target_user + remember_me(target_user) sign_in(target_user) + flash.delete(:error) + flash.delete(:alert) + flash.delete(:notice) return root_path end |