-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
loopback/authentication this.fail is not a function #3032
Comments
Apologies for the broken example, we are in the midst of landing different PRs which feat: resolve authentication strategy registered via extension point landed in early May and it was a breaking change; bumping @loopback/authentication to Draft:Changes to passport strategy adapter will be updating how passport strategies are handled given the new authentication strategy interface. We are exploring a few options right now. Once things have been decided, the documentation you mention will be updated. refactor shopping cart example to utilize latest @loopback/authentication module also landed and uses We are also in the midst of making documentation changes : You probably were following either of these two documents which are out of date: https://loopback.io/doc/en/lb4/Decorators_authenticate.html https://github.com/strongloop/loopback-next/tree/master/packages/authentication So please stay tuned... :) |
@vikramkh I think you are using a passport based strategy which is not supported yet in |
After following the setup for loopback/authentication, and adding the decorator: @authentication('BasicStrategy') to my users controller, I get the error:
Unhandled error in GET /users/count: 500 TypeError: this.fail is not a function
at BasicStrategy.authenticate (/Users/myName/folder/node_modules/passport-http/lib/passport-http/strategies/basic.js:69:17)
at AuthenticateActionProvider.action (/Users/myName/folder/node_modules/@loopback/authentication/dist/providers/auth-action.provider.js:55:44)
Error: 500
Internal Server Error
Unhandled error in GET /users/count: 500 TypeError: this.fail is not a function
at BasicStrategy.authenticate
Expected Behavior
Error: 400
Authentication Required
The text was updated successfully, but these errors were encountered: