Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

fix: return a null token if the token is invalid or fails verification #27

Merged
merged 1 commit into from
May 20, 2020
Merged

fix: return a null token if the token is invalid or fails verification #27

merged 1 commit into from
May 20, 2020

Conversation

jonestristand
Copy link
Contributor

Currently, with the most recent build of nexus, passing an invalid Bearer token in the authorization header causes jsonwebtoken to throw an error on verify(...), which is not caught properly by nexus and results in unhandledRejection which terminates the nexus application.

This PR adds a try/catch block around jsonwebtoken.verify to return a null token in the context if the token provided is invalid (same behaviour as if the Authorization header was invalid)

@jonestristand jonestristand changed the title Fixed to return a null token if the token is invalid or fails verific… fix: return a null token if the token is invalid or fails verification May 20, 2020
@Camji55
Copy link
Owner

Camji55 commented May 20, 2020

Awesome work! Thanks for your contribution 🙏

@Camji55 Camji55 merged commit 2914715 into Camji55:master May 20, 2020
@Camji55
Copy link
Owner

Camji55 commented May 20, 2020

Fix is available in version 1.1.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants