I’ve got a quite small personnal project using EmberJS with an API.
I’m using this project mostly as a sandbox of things to try out. So it probably won’t ever be public.
One of the things I’m trying to achieve with this project is completely decouple the API and the EmberJS app.
They are two different apps, running on two different hosts. And the EmberJS app has no access to any data except through the API.
One of the difficulties this posed was to manage user authentication.
Very basically, when authenticating, we’re creating a new instance of the Session model.
It’s data are stored in localStorage for retrieval after reloading the page.
This means I have a SessionStore object, which does the retrieval from localStorage and signs the user in if we already have a valid API token.
Your new post is loading...