Skip to content

Conversation

@jmacmahon
Copy link

@jmacmahon jmacmahon commented Aug 12, 2020

Description

This brings the message for a token with (for example) a trailing space into line with the listed potential error messages in the README.

"invalid token" is confusing and not a listed possible error message -- is it invalid because it was corrupt, unauthorized, expired, etc.?

This also adds a test for the existing case where "jwt malformed" is returned, which was otherwise untested.

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

This brings the message for a token with (for example) a trailing space
into line with the listed potential error messages in the README.
@jmacmahon
Copy link
Author

Any thoughts on this?

decodedToken = decode(jwtString, { complete: true });
} catch(err) {
return done(err);
}

Choose a reason for hiding this comment

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

asasasASASA

var token = jwt.sign({ foo: 'bar' }, secret, { algorithm: 'HS256' });

it('should return the "invalid token" error', function(done) {
it('should return the "jwt malformed" error with a trailing space', function(done) {

Choose a reason for hiding this comment

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

What might have happened to have the malformed JWT, it's because on my app, it has been working fine, and then lately I get jwt malformed error message, if I refresh the page, I will no longer see that error again, can you please give me details on this.

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