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

client: use Authentication class, make `getJWT` and `verifyJWT` async #317

Merged
merged 5 commits into from Oct 19, 2016

Conversation

Projects
None yet
2 participants
@marshallswain
Copy link
Member

marshallswain commented Oct 17, 2016

This modifies both getJWT and verifyJWT to return promises. getJWT has also been updated to check the store for the token again to support environments that don’t load cookies immediately.

Also renames the getJWT util function to retrieveJWT to avoid ambiguity.

marshallswain added some commits Oct 17, 2016

client: make `getJWT` and `verifyJWT` async
This modifies both `getJWT` and `verifyJWT` to return promises.  `getJWT` has also been updated to check the store for the token again to support environments that don’t load cookies immediately.

@marshallswain marshallswain self-assigned this Oct 17, 2016

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Oct 18, 2016

Didn't we want to create an Authentication class for this (we can always map some of its methods directly to the app object)? I can do that, too when wrapping this up though.

@justinbmeyer justinbmeyer referenced this pull request Oct 18, 2016

Closed

Perfect Sessions in CanJS / Feathers / Bitcentive #83

7 of 13 tasks complete

marshallswain added some commits Oct 18, 2016

Prevent saving ‘null’ or ‘undefined’ into storage
Some forms of webStorage plugins, when you pass `null` or `undefined` will actually stringify it into `’null’` or `’undefined’`, which results in a malformed jwt error when `verifyJWT` is run.  This prevents that.

@marshallswain marshallswain changed the title client: make `getJWT` and `verifyJWT` async client: use Authentication class, make `getJWT` and `verifyJWT` async Oct 19, 2016

@marshallswain

This comment has been minimized.

Copy link
Member Author

marshallswain commented Oct 19, 2016

@daffl I've updated it to use a class.

@marshallswain marshallswain merged commit adbd9d9 into 0.8 Oct 19, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@marshallswain marshallswain deleted the 0.8-client-api-async branch Oct 19, 2016

@marshallswain marshallswain restored the 0.8-client-api-async branch Oct 19, 2016

@marshallswain marshallswain deleted the 0.8-client-api-async branch Oct 19, 2016

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.