Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

expires_in does not work in initializer properly #105

Closed
romikoops opened this issue Sep 28, 2017 · 0 comments
Closed

expires_in does not work in initializer properly #105

romikoops opened this issue Sep 28, 2017 · 0 comments

Comments

@romikoops
Copy link

From documentation ...

In Rails, an auto-expiry of 1 month is set by default. You can alter that deal in an initializer with:

# config/initializers/global_id.rb
Rails.application.config.global_id.expires_in = 3.months

Unfortunately in my case it loads after railtie initializer (https://github.com/rails/globalid/blob/master/lib/global_id/railtie.rb#L16)
As result, it does not work, because SignedGlobalID.expires_in is set with default 1.month

My application details:

Rails 5.1.2

*** LOCAL GEMS ***

globalid (0.4.0)

As a workaround, I put config.global_id.expires_in = 3.months to config/application.rb

Should be fixed or the doc should be updated

jeremy pushed a commit that referenced this issue Oct 31, 2018
Closes #105

This sets `GlobalID.app` and `SecureGlobalID.expires_in` to the default
values and then allows overwriting them via `config.global_id.app` and
`config.global_id.expires_in` in an `config/initializers/*.rb`
file.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant