aboutsummaryrefslogtreecommitdiff
path: root/config/initializers/session_store.rb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2020-10-05 21:51:37 +0200
committerhellekin <hellekin@cepheide.org>2020-10-05 21:51:37 +0200
commit48031dde29d6dc4a0ba84c445ae4c07627257d4a (patch)
treefdbe4b896b04ad9e39ebb0b73516b77b61330dd2 /config/initializers/session_store.rb
parent81fb71f0510a5464634a65d97939f6fa54f419dd (diff)
downloadincommon-map-48031dde29d6dc4a0ba84c445ae4c07627257d4a.tar.gz
Configure Discourse SSO
We're creating a minimal User model that will be filled from SSO. We also configure Inflections so we can use SSO instead of Sso which looks weird for a module named after an acronym. Use Discourse as SSO: https://meta.discourse.org/t/using-discourse-as-a-sso-provider/32974
Diffstat (limited to 'config/initializers/session_store.rb')
-rw-r--r--config/initializers/session_store.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
new file mode 100644
index 0000000..4af1519
--- /dev/null
+++ b/config/initializers/session_store.rb
@@ -0,0 +1,6 @@
+if Rails.env.production?
+ # Only serve session cookies over HTTPS
+ Rails.application.config.session_store :cookie_store, key: 'map_session', expire_after: 7.days, httponly: true, secure: true
+else
+ Rails.application.config.session_store :cookie_store, key: 'map_session', expire_after: 7.days
+end