about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-01-24 21:52:45 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-01-24 22:01:05 +0100
commit6a2f248fe4ed59f512dd318a006209fb7b71aa7e (patch)
treeb9b9ae83840789da36047647be84c9cec457bc67
parent3f6a36168fd74e932a301923ea3805c1e848d66e (diff)
Renew Rails session ID on successful registration
-rw-r--r--app/controllers/auth/registrations_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb
index 3c9b38a4b..0db9cb84d 100644
--- a/app/controllers/auth/registrations_controller.rb
+++ b/app/controllers/auth/registrations_controller.rb
@@ -141,6 +141,11 @@ class Auth::RegistrationsController < Devise::RegistrationsController
 
   def sign_up(resource_name, resource)
     clear_captcha!
+
+    old_session_values = session.to_hash
+    reset_session
+    session.update old_session_values.except('session_id')
+
     super
   end