-
Notifications
You must be signed in to change notification settings - Fork 57
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
Add support for custom middleware to handle unauthorized. #24
Closed
Commits on May 30, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 9161397 - Browse repository at this point
Copy the full SHA 9161397View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3f4814f - Browse repository at this point
Copy the full SHA 3f4814fView commit details
Commits on Aug 6, 2021
-
feat: enable custom unauthorized handling via middleware
Current behavior supports: - string, rendered as text in response - object, rendered as JSON object in response This enhancement enables passing a normal middleware. It allows full customization of the response handling in the case of unauthorized: ```JavaScript app.use(basicAuth({ unauthorizedResponse: function(req, res, next) { // use an application's existing error handling stack if (req.auth) { next(new UnauthorizedError('Login required')); return; } // or send an html page if (req.accepts('html') { res.render('unauthorized'); return; } // or whatever you like! res.status(403) send({ message: 'That user will NEVER have access. Ever!' }); } })); ``` fixes LionC#23
Configuration menu - View commit details
-
Copy full SHA for 8d3c2e1 - Browse repository at this point
Copy the full SHA 8d3c2e1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a97797 - Browse repository at this point
Copy the full SHA 7a97797View commit details
Commits on Aug 7, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 48d7041 - Browse repository at this point
Copy the full SHA 48d7041View commit details -
Configuration menu - View commit details
-
Copy full SHA for e13b2d6 - Browse repository at this point
Copy the full SHA e13b2d6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 192e8ca - Browse repository at this point
Copy the full SHA 192e8caView commit details -
Configuration menu - View commit details
-
Copy full SHA for fdab80c - Browse repository at this point
Copy the full SHA fdab80cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9839c97 - Browse repository at this point
Copy the full SHA 9839c97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 72bf15b - Browse repository at this point
Copy the full SHA 72bf15bView commit details -
Configuration menu - View commit details
-
Copy full SHA for a922028 - Browse repository at this point
Copy the full SHA a922028View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3ac09ed - Browse repository at this point
Copy the full SHA 3ac09edView commit details -
ci: remove typescript compiler check from build test
The typescript check seems out of date, since it's currently failing with hundreds of errors. Further investigation is needed to re-enabe this. Better to disable for now and have the build run successfully on the core codebase.
Configuration menu - View commit details
-
Copy full SHA for 2579b12 - Browse repository at this point
Copy the full SHA 2579b12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 38ef684 - Browse repository at this point
Copy the full SHA 38ef684View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.