Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Proper way to save jwt in cookies #41

Closed
tention opened this issue Apr 16, 2017 · 4 comments
Closed

Proper way to save jwt in cookies #41

tention opened this issue Apr 16, 2017 · 4 comments

Comments

@tention
Copy link

tention commented Apr 16, 2017

Am very new to this client. Sorry but this might not be an issue to the library, I could not get jwt properly stored within cookie after login. Cookie is enabled in the properties. Did I miss out any other configuration?

"cookie": { "enabled": true, "name": "feathers-jwt", "httpOnly": false, "secure": false }

Should the storage be changed to something else for cookies to work?

export const app = feathers() .configure(rest(host).superagent(superagent)) .configure(feathers.hooks()) .configure(auth({ storage: window.localStorage, type: 'jwt', }));

Thanks

@marshallswain
Copy link
Member

Those options should be configured on the server. That's all it should take.

@tention
Copy link
Author

tention commented Apr 16, 2017

Should I add a hook to include setCookie on the server? or it should be there automatically?

Cookies was added successfully when i used oauth2 (facebook), but not the local.

@marshallswain
Copy link
Member

marshallswain commented Apr 16, 2017

Hmmm... If that's the case, please open an issue in feathers-authentication-local and close this one. It should be there automatically. We had to make a fix to the OAuth2 plugin that might need to happen in that one, too.

@tention
Copy link
Author

tention commented Apr 17, 2017

@tention tention closed this as completed Apr 17, 2017
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

2 participants