Skip to content

Empty secret or public key - #72

Merged
jfromaniello merged 4 commits into
auth0:masterfrom
JackuB:empty_secretOrPublicKey
Jul 15, 2015
Merged

jfromaniello merged 4 commits into
auth0:masterfrom
JackuB:empty_secretOrPublicKey

Conversation

@JackuB

@JackuB JackuB commented Mar 30, 2015

Copy link
Copy Markdown
Contributor

When secret or key fails to load or is not provided, verify can throw error even with callback.

Added check for null and undefined

Comment thread index.js Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we change this to just:

if (!secretOrPublicKey) {
  return done(new JsonWebTokenError('secret or public key must be provided'));
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtwebman I got impression, that key is allowed to have value of '' (empty string).

Seems safer to check even for empty string, updated code.

@jfromaniello
jfromaniello merged commit f1cffd0 into auth0:master Jul 15, 2015
@jfromaniello

Copy link
Copy Markdown
Contributor

Thank you very much, published as v5.0.4.

@JackuB
JackuB deleted the empty_secretOrPublicKey branch July 16, 2015 06:36
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 this pull request may close these issues.

3 participants