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

401 improvement #95

Open
smebberson opened this issue Feb 7, 2020 · 1 comment
Open

401 improvement #95

smebberson opened this issue Feb 7, 2020 · 1 comment

Comments

@smebberson
Copy link

Describe the problem you'd like to have solved

I'd like to improve the integration of this library when it comes to 401 responses.

Describe the ideal solution

The README clearly states that The idea is that you will use another mechanism to validate the user first.

However, I think that return res.send(401); should be updated to actually call a default function. Then when configuring this library via auth, you can pass in a function to override the default handling.

This is line with how the library works when it comes to customising handling.

Alternatives and current work-arounds

The current work around is to have some extra middleware that runs before this one to validate the user first. However, I feel that looses a bunch of context when working with auth, and I feel that solution is more inline with how other parts of auth work.

Additional context

I'd be happy to provide a PR if this is something you're interested in.

@luuuis
Copy link
Contributor

luuuis commented Oct 22, 2020

Related to #88

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

No branches or pull requests

2 participants