about summary refs log tree commit diff
path: root/config/initializers
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-07-26 21:22:43 +0200
committerThibaut Girka <thib@sitedethib.com>2018-07-26 21:22:43 +0200
commit6141c2a035fc8fe76b2b460aeeeeed59a1bd29f9 (patch)
tree5a522712adf913cfb9d426fe8798ae29ff9e2702 /config/initializers
parent82ab5aacb24edf793f391cb4122116bf92ee0e7a (diff)
parent3c35b34b612c210c97ce8cffda33798ffa8f22e8 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/devise.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index e0d263f16..8532c9d9a 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -9,6 +9,7 @@ Warden::Manager.after_set_user except: :fetch do |user, warden|
     value: session_id,
     expires: 1.year.from_now,
     httponly: true,
+    secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'),
   }
 end
 
@@ -18,6 +19,7 @@ Warden::Manager.after_fetch do |user, warden|
       value: warden.cookies.signed['_session_id'] || warden.raw_session['auth_id'],
       expires: 1.year.from_now,
       httponly: true,
+      secure: (Rails.env.production? || ENV['LOCAL_HTTPS'] == 'true'),
     }
   else
     warden.logout