Allow customizing whethere the cookie is secure or not

This commit is contained in:
Hugo Peixoto 2023-11-13 09:08:12 +00:00
parent 5c35572d29
commit f69e3ff01a
2 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@ Clearance.configure do |config|
config.allow_sign_up = false config.allow_sign_up = false
config.mailer_sender = ENV['SMTP_FROM_ADDRESS'] config.mailer_sender = ENV['SMTP_FROM_ADDRESS']
config.rotate_csrf_on_sign_in = true config.rotate_csrf_on_sign_in = true
config.secure_cookie = true config.secure_cookie = ENV.fetch("SECURE_COOKIE", "true") == "true"
config.signed_cookie = true config.signed_cookie = true
config.sign_in_guards = ["ActiveGuard"] config.sign_in_guards = ["ActiveGuard"]
end end

View File

@ -14,5 +14,6 @@ IFTHENPAY_BO_KEY=XXXX-XXXX-XXXX-XXXX
IFTHENPAY_AP_KEY=my_anti_phishing_key IFTHENPAY_AP_KEY=my_anti_phishing_key
BASE_HOST=example.org BASE_HOST=example.org
SECURE_COOKIE=true
RAILS_LOG_TO_STDOUT=true RAILS_LOG_TO_STDOUT=true
RAILS_ENV=production RAILS_ENV=production