Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Does not work in Rails 3.2 #5

Open
Overload119 opened this issue Aug 5, 2015 · 3 comments
Open

Does not work in Rails 3.2 #5

Overload119 opened this issue Aug 5, 2015 · 3 comments

Comments

@Overload119
Copy link

A secret is required to generate an integrity hash for cookie session data. Use config.secret_token = "some secret phrase of at least 30 characters"in config/initializers/secret_token.rb

@Overload119
Copy link
Author

      config.after_initialize do |app|
        if app.secrets.secret_key_base.blank?
          raise "Missing `secret_key_base` for '#{Rails.env}' environment, set this value in `config/secrets.yml`"
        else
          app.config.secret_key_base = app.secrets.secret_key_base
        end
      end

Is probably the issue.
Rails expects secret_token right?

@Overload119
Copy link
Author

An alternative way to get this to work;

Don't remove the secret_token.rb as suggested in the README, instead just change it to this.

# Be sure to restart your server when you modify this file.

# Your secret key for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.

# Set token based on intialize_secret function (defined in initializers/secret_generator.rb)
RailsApp::Application.config.secret_token = Rails.application.secrets.secret_key_base

@gregblass
Copy link

Confirmed. Doesn't work with Rails 3.2 out of the box without doing something like this. This should probably go in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants