Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Error is not thrown if token that is provided is invalid #421

Closed
elfey opened this issue Feb 13, 2017 · 4 comments
Closed

Error is not thrown if token that is provided is invalid #421

elfey opened this issue Feb 13, 2017 · 4 comments

Comments

@elfey
Copy link

elfey commented Feb 13, 2017

If an invalid feathers-jwt token exists in the localStorage of a browser and app.authenticate() is called, the Promise on the client side always resolves, whether or not the token was valid on the server.

I'm assuming that this is because an error isn't thrown on the server side when authentication fails via the JWT authentication strategy.

This has obvious implications on the client side, because now error handling has to be done via .then as opposed to .catch.

Again, the Promise always ends up resolving whether or not the JWT token that is passed to the server is valid.

@daffl
Copy link
Member

daffl commented Feb 15, 2017

I think we should move this issue to https://github.com/feathersjs/feathers-authentication-client. Either way, you are right, an invalid JWT shouldn't resolve. I'd have to double check why that is.

@ekryski
Copy link
Member

ekryski commented Feb 20, 2017

This shouldn't be happening. I will look into this a bit but @elfey it would help a ton if you can post a reproducable example or a PR with a breaking test. We do have tests to test this case already that are passing. https://github.com/feathersjs/feathers-authentication-client/blob/master/test/integration/rest.test.js#L88-L132

@elfey
Copy link
Author

elfey commented Feb 20, 2017

Will do, I'll get an example in here within the next few days.

@elfey
Copy link
Author

elfey commented Feb 27, 2017

After speaking with Marshall in the Slack and doing some more thorough debugging, it looks like this actually isn't a problem of feathers; it's a problem specific to my project.

I'd like to apologize for any confusion this may have caused.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants