2
votes

I am using Ember Simple Auth to authenticate with my backend. I almost got it working. The Problem is now how I get it nicely together with Ember-Data. I have some ressources that have end points like this:

/api/users/:user_id/activities

The Problem is now that I don't know how to inject the :user_id for this route from the current user.

And there are some other scenarios when I want to show the data of another user and in that cases I would obviously pass a different user ID.

My routes are also not helping, since I am showing the activies on the dashboard, and therefore don't have the user_id in the route. Only in the session, or where SimpleAuth stores the user.

1

1 Answers

0
votes

There's an example in the Ember.SimpleAuth repo that shows how to extend it with an authenticated account/current user: https://github.com/simplabs/ember-simple-auth/blob/master/examples/4-authenticated-account.html