discourse/config/initializers/100-session_store.rb
Sam e765e84941
DEV: allow developers to use HTTPS if they wish (#26384)
Warning is getting tiring on local and I have https://l.discourse working just fine (tm)
2024-03-27 10:48:04 +11:00

29 lines
800 B
Ruby

# frozen_string_literal: true
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store(
:discourse_cookie_store,
key: "_forum_session",
path:
(
if (Rails.application.config.relative_url_root.nil?)
"/"
else
Rails.application.config.relative_url_root
end
),
)
Rails.application.config.to_prepare do
if Rails.env.development? && SiteSetting.force_https && !ENV["DISCOURSE_DEV_ALLOW_HTTPS"]
STDERR.puts
STDERR.puts "WARNING: force_https is enabled in dev"
STDERR.puts "It is very unlikely you are running HTTPS in dev."
STDERR.puts "Without HTTPS your session cookie will not work"
STDERR.puts "Try: bin/rails c"
STDERR.puts "SiteSetting.force_https = false"
STDERR.puts
end
end