I am using the sorcery gem in a Rails 6 application.
I need to use variable in sorcery.rb at controller, however I do not know how to get the value.
Rails.application.config.sorcery.submodules = [:user_activation]
Rails.application.config.sorcery.configure do |config|
config.user_config do |user|
user.activation_token_expiration_period = 60 * 60 * 24 * 7 # <= this
end
end
How can I get this?
If you have an instance of User
you can do it this way:
User.new.sorcery_config.activation_token_expiration_period