serve-handler
serve-handler copied to clipboard
Add HTTP Auth
It would be nice if we could have and HTTP auth flag which we can define in the now.json. There are a few static pages that I have that I would like to hide behind a basic auth.
I believe the feature existed in previous versions of server but it is gone now.
cc @leo
Yes, some kind of password protection would be nice.
Before [email protected], one could use SERVE_USER and SERVE_PASSWORD in the now.json to password-protect static deployments.
Looks like this feature has gone for all zeit static hosted websites that relied on it ? (even premium) ?
I need to add some kind of password protection to my deployments too.
As it isn't supported "natively" by now, maybe there's the possibility to use node.js or PHP (or any other server language) to send back the good auth headers so the browser asks the user for authentication, like with HTTP Basic Authentication. Then you'd have to check the credentials by yourself in your code.
EDIT: I've put together an example of how to implement Basic Auth manually using node.js : https://github.com/flawyte/now-basic-auth
Basic auth would be great while still developing applications that are not supposed to be public yet. Bonus points for adding an IP whitelist too serve as well.
I submitted a PR to this and zeit/schemas to support this, hopefully it'll take 🤞
https://github.com/zeit/serve-handler/pull/96 and https://github.com/zeit/schemas/pull/54
Really would like to have this feature too, to protect my dev environment to be discovered and used accidentally
Bumping this.
shameless self-promotion alert:
this feature is available in my @warren-bank/serve fork of serve
Any progress?