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

token_randomness can't be changed #276

Open
cybercent opened this issue Mar 12, 2021 · 3 comments
Open

token_randomness can't be changed #276

cybercent opened this issue Mar 12, 2021 · 3 comments
Labels
bug Something isn't working to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed.

Comments

@cybercent
Copy link

Please complete all sections.

Configuration

  • Sorcery Version: 0.15
  • Ruby Version: 2.7.1
  • Framework: 6
  • Platform: -

Expected Behavior

Able to change token_randomness=

Actual Behavior

Seting token_randomness= causes a Rails issue.

undefined method `token_randomness=` for Sorcery::Controller::Config:Module

Steps to Reproduce

Set token_randomness=20 in the config file.

@joshbuker
Copy link
Member

@cybercent Version 0.16.0 included some bugfixes, can you try the latest version and see if it still breaks when setting token_randomness?

@joshbuker joshbuker added the bug Something isn't working label Mar 12, 2021
@joshbuker
Copy link
Member

@cybercent issue confirmed, it appears to have been introduced when the configurable randomness was originally added. See: #67

Makes me wonder if the feature was ever actually working...

Regardless, v1 has significantly overhauled the config, and iirc I also moved the token gen functionality around. I'll double check that this is resolved on v1, but I don't have the bandwidth to address this in v0 unless someone else creates the PR to fix it.

@joshbuker joshbuker added the to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed. label Jun 5, 2021
@MrGrinst
Copy link

MrGrinst commented Mar 6, 2022

It looks like that attribute needs to be nested in config.user_config and not in the root config.

I just got it to to work by doing this:

Rails.application.config.sorcery.configure do |config|
  # config.token_randomness = 20 <- this doesn't work
  config.user_config do |user|
    user.token_randomness = 20 # <- this works!
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working to be implemented in v1 This issue or pull request will be resolved in the v1 rework, but has not yet been completed.
Projects
None yet
Development

No branches or pull requests

3 participants