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

[1.0] Only the first failure is returned on auth failure when chaining multiple strategies #346

Closed
ekryski opened this Issue Nov 21, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@ekryski
Copy link
Member

ekryski commented Nov 21, 2016

Steps to reproduce

Register mulitple strategies like so and send a bad username and password.

app.service('authentication').hooks({
  before: {
    create: [
      auth.hooks.authenticate(['jwt', 'local'])
    ]
  }
});

Expected behavior

It should return all failures or return the one for the strategy you were attempting to authenticate with.

Actual behavior

If you have registered multiple strategies to be checked against, it only returns the first one that fails . This is very misleading as to what the actual error is that caused auth failure.

In the above example it if you provided a bad username and password auth would fail but it would return the failure from the jwt strategy, which would be that the token is missing or something.

System configuration

Tell us about the applicable parts of your setup.

Module versions: feathers-authentication@1.0.0-beta

NodeJS version: all

Operating System: all

Browser Version: all

React Native Version: all

Module Loader: all

@ekryski ekryski added this to the 1.0 milestone Nov 21, 2016

ekryski added a commit that referenced this issue Nov 23, 2016

checking strategy options on sockets. Now supporting entity id for JW…
…T payload. Only auth passed strategy. Closes #346. Closes #348.

@ekryski ekryski closed this in #349 Nov 23, 2016

ekryski added a commit that referenced this issue Nov 23, 2016

checking strategy options on sockets. Now supporting entity id for JW…
…T payload. Only auth passed strategy. Closes #346. Closes #348. (#349)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.