1

I am trying to port an app that is early in development from .NET to Node/Sails/Passport. The UI is an emberjs app. The backend can authenticate users using Facebook. That is tested and working.

To now start integrate that into the UI i have made the following commit:

https://github.com/wayne-o/sonatribe/commit/9c50f7fe7200251196543a59ae51c1e149de83ae

As you can see I am pulling in ember-simple-auth

Now, I have no idea how to get ember-simple-auth to see that once I visit http://someauthservice.com/auth/facebook and authenticate that I now have a valid session with the server.

Inside my header (https://github.com/wayne-o/sonatribe/blob/master/src/sonatribe-ui/app/templates/header.hbs) i am doing:

{{#if session.isAuthenticated}}
      the user is authenticated
{{/if}}

but this is never true.

So my q is how do i finish off wiring all this up?

Travis Webb
  • 14,688
  • 7
  • 55
  • 109
  • Try `session.get('isAuthenticated')` – laggingreflex Jan 08 '15 at 10:31
  • It doesn't look like your login form is using ember-simple-auth's login controller mixin. – Peter Brown Jan 08 '15 at 12:00
  • Where does the actual login happen in the app? I don't see anything in that commit. – marcoow Jan 08 '15 at 12:04
  • @marcoow for now I am just navigating to /dev.festivaltribe.co.uk:1337/auth/facebook which is the passport auth endpoint –  Jan 08 '15 at 12:32
  • @Beerlington I am just trying to get FB auth to work for now - need to rejigg the local stuff still –  Jan 08 '15 at 12:33
  • You need to use an Ember Simple Auth authenticator - checkout the README: https://github.com/simplabs/ember-simple-auth#readme. Ember Simple Auth torii might be what you'd want to use: https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-torii#readme – marcoow Jan 08 '15 at 12:39
  • @marcoow It's not because I haven't included application-route-mixin in the route is it? –  Jan 08 '15 at 13:15
  • adding application-route-mixin didn't change anything... I haven't used torii before but this is starting to feel like quite a deep rabbit hole :/ –  Jan 08 '15 at 13:27
  • It looks like you're just never authenticating Ember Simple Auth's session so that's why it's never authenticated ;) – marcoow Jan 08 '15 at 13:50
  • @marcoow mind if I move this to chat? –  Jan 08 '15 at 13:51
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68415/discussion-between-marcoow-and-iwayneo). – marcoow Jan 08 '15 at 14:14

0 Answers0