-
Notifications
You must be signed in to change notification settings - Fork 57
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
Typescript example fails #30
Comments
Huh, that should work. That always worked like this, not only for this library. |
Check to see if you have |
Same issue but for standard Exrpess:
Tried the suggestion Current workaround: app.use(
passport.authenticate('oauth-bearer', { session: false }),
(next: CallableFunction) => {
next()
}
) Another option is to start the unused variables with an underscore: app.use(
passport.authenticate('oauth-bearer', { session: false }),
(_req, _res, next) => {
next()
}
) TypeScript version 3.9.7 |
For me import * as basicAuth from 'express-basic-auth';
...
app.use(basicAuth.default({
users: {
uname: 'secret',
},
challenge: true,
})); |
Fails for me as well. Can't get |
I did not maintain the package for a while (simply did not have time), but I recently returned to open source work. I will revive my TS rewrite branch next week and make sure to release a new version written in Typescript until the end of the month, as a lot of people still depend on this package. Thank you for the patience and activity everyone :-) |
Any update here, @LionC ? |
The provided typescript usage produces a typescript error:
Produces this error:
This expression is not callable.
Type 'typeof expressBasicAuth' has no call signatures.ts(2349)
service.ts(6, 1): Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.
The text was updated successfully, but these errors were encountered: