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

Fix for wrongly handled jwt error #1

Merged
merged 1 commit into from
Oct 6, 2020

Conversation

SreejithNS
Copy link
Owner

Previously the Error wasn't handled completely and was passed on. That ended up throwing the entire Error as html to response. Which exposed the source files and line numbers.

Previously the Error wasn't handled completely and was passed on. That ended up throwing the entire Error as html to response. Which exposed the source files and line numbers.
@SreejithNS SreejithNS merged commit 5b0c467 into master Oct 6, 2020
@SreejithNS SreejithNS deleted the SreejithNS-jwt-error-handled branch October 6, 2020 16:36
@@ -50,7 +50,7 @@ app.all("*", function(req, res) {

app.use((err, req, res) => {
if(err.name == "UnauthorizedError"){
return apiResponse.unauthorizedResponse(res, err.message);
apiResponse.unauthorizedResponse(res, err.message);
Copy link
Owner Author

Choose a reason for hiding this comment

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

A return will again pass the error to next middleware, if nothing handles then it will be thrown as uncaught.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant