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

Open
nbibler opened this issue Jul 18, 2019 · 0 comments
Open

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

nbibler opened this issue Jul 18, 2019 · 0 comments

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) } }
)

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

1 participant