lib/ahoy_email/engine.rb in ahoy_email-2.2.0 vs lib/ahoy_email/engine.rb in ahoy_email-2.3.0
- old
+ new
@@ -2,10 +2,14 @@
module AhoyEmail
class Engine < ::Rails::Engine
initializer "ahoy_email" do |app|
AhoyEmail.secret_token ||= begin
+ tokens = []
+ tokens << app.key_generator.generate_key("ahoy_email")
+
+ # TODO remove in 3.0
creds =
if app.respond_to?(:credentials) && app.credentials.secret_key_base
app.credentials
elsif app.respond_to?(:secrets)
app.secrets
@@ -13,10 +17,12 @@
app.config
end
token = creds.respond_to?(:secret_key_base) ? creds.secret_key_base : creds.secret_token
token ||= app.secret_key_base # should come first, but need to maintain backward compatibility
- token
+ tokens << token
+
+ tokens
end
end
end
end