0

I am having a bit of an issue with a small ember app which uses GitHub/Facebook authentication implemented with ember-simple-auth (with torii) within ember-cli.

Login works nice, I seam to be authenticated but I would like to know who is logged in. In this end, I switched to cookie store, hoping that when I send a store request to the server, I would have some data about the authenticated user, but I don’t.

So, my first question is how do I retrieve the authenticated user? Then, how do I make the torii-adapter use ember-data?

I’d be happy to post any needed code here, just don’t know what to post. Let me know what code is needed to answer the question and I’ll post it.

Thanks in advance!

Eduárd Moldován
  • 1,495
  • 3
  • 13
  • 29

1 Answers1

2

This has been answered here as well as on github several times. Search SO or see this example for solutions.

marcoow
  • 4,062
  • 1
  • 14
  • 21
  • Sorry, I didn’t find those answers. I’ll check the linked example again. – Eduárd Moldován Jan 05 '15 at 19:24
  • Sadly, I still don’t get it. The example you mention if entirely different from what I need. Do you have any example of loging in with github (or whatever) and sending session data (the authenticated user himself) to the server in any way? Ember-data would be the ideal way. – Eduárd Moldován Jan 06 '15 at 21:33
  • The example shows how to make the current user available via the session: https://github.com/simplabs/ember-simple-auth/blob/master/examples/4-authenticated-account.html#L132. for this to work the authenticator you use has to return a promise that resolves with sth. that allows you to identify and load the current user. This question covers the same scenario with using torii to authenticate against Google: http://stackoverflow.com/questions/27553593/ember-simple-auth-with-torii-access-user-info – marcoow Jan 07 '15 at 14:17
  • Those links are sadly dead. – Jon Dec 27 '15 at 18:00
  • The whole concept of custom sessions doesn't exist anymore since 1.0. Instead you can just use a service - see the dummy app in the repo: https://github.com/simplabs/ember-simple-auth/tree/master/tests/dummy/app/services – marcoow Jan 05 '16 at 11:04