vendredi 24 juillet 2015

How to setup ember-simple-auth if rails is handling the login forms

Im a bit stuck. I dont know how to setup ember-simple-auth with my current rails + ember-cli app.

Currently, the user has to login with steam, so they get redirected to steam's login page. When they press authorize, they get redirected back to my site. I then let rails process the request and if they successfully signed in with steam, I set a cookie with a randomly generated token.

Now I need to do two things for ember-simple-auth.

  1. Tell ember-simple-auth to check if the token exists, and if it does, make an api call to get the user's infor like the name, email, username, etc...
  2. Add a prefilter that passes the token in most requests.

For #2, I can just use the OAuth authorizer, but for #1, I have no idea.

Thanks.




Aucun commentaire:

Enregistrer un commentaire