mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Support for :credentials on Rails v5.2.x. (#4712)
This fixes #4710. Rails introduced :secrets in v5.1. They somehow changed it to :credentials. This fix represents this change. Devise will now look :credentials first, then fallback to :secrets for 5.1.x compatibility then it will check for standard secret key. If three not found then exception will arise.
This commit is contained in:
parent
e55c9caa05
commit
bdd6081815
1 changed files with 3 additions and 1 deletions
|
@ -34,7 +34,9 @@ module Devise
|
|||
end
|
||||
|
||||
initializer "devise.secret_key" do |app|
|
||||
if app.respond_to?(:secrets)
|
||||
if app.respond_to?(:credentials)
|
||||
Devise.secret_key ||= app.credentials.secret_key_base
|
||||
elsif app.respond_to?(:secrets)
|
||||
Devise.secret_key ||= app.secrets.secret_key_base
|
||||
elsif app.config.respond_to?(:secret_key_base)
|
||||
Devise.secret_key ||= app.config.secret_key_base
|
||||
|
|
Loading…
Add table
Reference in a new issue