× {{alert.msg}} Never ask again
Get notified about new tutorials RECEIVE NEW TUTORIALS

Ember-Simple-Auth currentUser example help required

Marco Otte-Witte
Mar 07, 2015
<p>The SimpleAuth global is only defined in the browserified distribution of the library. When you're using ember-cli you import the individual components instead of accessing them via the global (see e.g. this example: <a href="http://log.simplabs.com/post/90339547725/using-ember-simple-auth-with-ember-cli" rel="nofollow">http://log.simplabs.com/post/90339547725/using-ember-simple-auth-with-ember-cli</a>).</p> <p>To e.g. get the session you'd do sty like:</p> <pre><code>import Session from 'simple-auth/session'; Session.reopen({ … }); </code></pre> <p>The example linked above requires the server to include the <code>user_id</code> in the response which is not compliant with the OAuth 2.0 specification but a customization. If you want/need to be compliant you could get the current user e.g. via a <code>GET /me</code> or sth. like that once the session is authenticated.</p> <p>This tip was originally posted on <a href="http://stackoverflow.com/questions/24758594/Ember-Simple-Auth%20currentUser%20example%20help%20required/24760072">Stack Overflow</a>.</p>

Get New Tutorials Delivered to Your Inbox

New tutorials will be sent to your Inbox once a week.

comments powered by Disqus