Closed AO19 closed 2 years ago
I cannot reproduce this issue with the code you've given.
The backtrace points to one of the values of your users
object not being a string. I'm guessing that the sample code you've posted is not what you're actually using. Look at your users
object and make sure that all of the values are strings.
Note that this module uses for ... in
instead of for ... of
to iterate this object, so it will iterate over inherited enumerable attributes. If your code or a dependency has extended Object.prototype
with enumerable attributes, you would run into this problem.
FWIW, this happens for me as well. When the browser (Chrome) prompts to credentials, and I just press submit (without entering a username or password), I get this error.
I someone else runs into this. I got this error and after some debugging I noticed I had defined a credential with undefined as password like below.
{
"username": undefined
}
@kenlju you saved me hours of debugging !
Version: 1.2.0
In my project basic-auth works just fine, with a custom Authorizer for specific routes.
But when I'm using this code,
for a unique endpoint, I'll get the following error:
Basically, what I'm doing is: User can enter a specific endpoint, the browser native challenge input pops up, after entering the credentials he gets to pass...
But I keep getting this error.