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

Default token_payload doesn't return a random hex value #32

Closed
nbibler opened this issue Jul 18, 2019 · 3 comments · Fixed by #56
Closed

Default token_payload doesn't return a random hex value #32

nbibler opened this issue Jul 18, 2019 · 3 comments · Fixed by #56

Comments

@nbibler
Copy link

nbibler commented Jul 18, 2019

The README indicates that if the token_payload is left unset, then it:

Defaults to a randomly generated token in a hash: { token: "RANDOM-TOKEN" }

However, that is not this library's current behavior.

The following is what is actually generated if you fail to set a token_payload:

{
  "token": "#<Method: SecureRandom.hex>"
}

The token payload's default value does not appear to be getting called (the hex method reference is simply being converted to a string) and no random hash is generated:

option(
:token_payload,
default: proc { { token: SecureRandom.method(:hex) } }
)

@ransombriggs
Copy link
Contributor

I can confirm this, I started with an empty config and noticed this as well when testing.

@ransombriggs
Copy link
Contributor

I pushed up a fix for this issue: #56

@nbulaj nbulaj closed this as completed in #56 Aug 8, 2024
@nbibler
Copy link
Author

nbibler commented Aug 8, 2024

Thank you, @ransombriggs!

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

Successfully merging a pull request may close this issue.

2 participants