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

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

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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Author

elfey commented Feb 20, 2017

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

@elfey

This comment has been minimized.

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 join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.