mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-24 22:42:27 -05:00
10 lines
395 B
Ruby
10 lines
395 B
Ruby
# We have had lots of config issues with SECRET_TOKEN to avoid this mess we are moving it to redis
|
|
# if you feel strongly that it does not belong there use ENV['SECRET_TOKEN']
|
|
#
|
|
token = ENV['SECRET_TOKEN'] || $redis.get('SECRET_TOKEN')
|
|
unless token && token.length == 128
|
|
token = SecureRandom.hex(64)
|
|
$redis.set('SECRET_TOKEN',token)
|
|
end
|
|
|
|
Discourse::Application.config.secret_token = token
|