Skip to content

loopback/authentication this.fail is not a function #3032

@vikramkh

Description

@vikramkh

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions