huafu / ember-data-feathers

Tools for Ember applications to communicate with FeatherJS using sockets.io
MIT License
7 stars 2 forks source link

No auth token #3

Open giano opened 7 years ago

giano commented 7 years ago

The library seems to "forget" the auth token association when I reload the page, even if the correct value is in localStorage.

Models requests are okay since I reload (even if I can't find any Authorization header in the websocket connection or its frames).

huafu commented 7 years ago

You have to do return feathers.authenticate().catch(function() {}) in the beforeModel hook of your application route, feathers being the injected service with feathers: Ember.inject.service().

This will try to find the token and login with it if there is one.

giano commented 7 years ago

Ok, thanks! Nice library. Actually went all way around JSON-APIfying Feathers (would like to have records paginated) but would like to keep up with this.

Have a nice day!