-
Notifications
You must be signed in to change notification settings - Fork 693
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 HTTP Basic Auth support #49
Conversation
Looks great! But please don't increment the version tag in |
Gotcha. Was wondering about that. I'll revert it when I get back to my computer later today. Great little library thanks for sharing! |
Did this so the library owners can choose to update it on their own.
I'd be interested in seeing a slightly different API. One that pulls user/pass from environment variables automatically (perhaps You can then optionally supply a user/pass directly to the auth command in case you want to override looking up the environment variables. So |
Hmm yeah this could be good. @leo any thoughts? |
👌 But let's only do the env vars, so that we can prevent people from hardcoding stuff. On now, env variables can be filled with secrets defined on the platform.
My dream world would be to only request a password and not a user, not sure if that's possible. |
Not possible with basic auth, but that would be dreamy for many many scenarios :) |
|
||
if (flags.auth) { | ||
const credentials = auth(req) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's missing error reporting if the env vars are not set
Oops. Hows that? |
Thanks! |
How can I use HTTP Basic Auth together with
|
@electerious The flag is missing: https://github.com/zeit/serve#authentication |
True, but how can I pass the |
@electerious It should be just like to did above. |
But |
Correct. You can't pass flags to serve via |
@electerious The |
is this feature documented? how to use in standalone? (not with |
#30