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

Password not required #30

Open
jackdent opened this issue Jul 1, 2014 · 1 comment
Open

Password not required #30

jackdent opened this issue Jul 1, 2014 · 1 comment

Comments

@jackdent
Copy link

jackdent commented Jul 1, 2014

Some APIs (including mine!) use HTTP Basic Auth, but read the username as an API token and ignore the password field. Notably, Stripe does this. It would be great to have the ability to pass a passwordRequired option, which defaults to true to preserve backwards compatability, but that can be set to false to disable the requirement.

From this:

var userid = credentials[0];
var password = credentials[1];
if (!userid || !password) {
    return this.fail(this._challenge());
}

To this:

var userid = credentials[0];
var password = credentials[1];
if (!userid || (options.passwordRequired && !password)) {
    return this.fail(this._challenge());
}

I'm happy to submit a pull request

@jackdent
Copy link
Author

jackdent commented Jul 1, 2014

#31

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

1 participant