ember-simple-auth

Ember SimpleAuth authenticate access to protected resources

好久不见. 提交于 2019-12-11 22:51:10
问题 I have an app where users can edit organisations in various 'pages'. App.Router.map(function() { this.resource('organisation', {path: '/:orgname'}, function () { this.route('foo'); this.route('bar'); }); }); I want users to be able to view any organisation but the various pages should become editable if the user has admin rights over the organisation. Organisations are editable based on some tricky logic handled by the server. The user model has an organisations attribute to reflect these

ember-simple-auth deferReadiness until user is loaded

半城伤御伤魂 提交于 2019-12-11 03:15:55
问题 I am using ember-cli-simple-auth and have extended the session object to include the currentUser which is retrieved from the /me endpoint. However, when the page is reloaded and the user is logged in there is a delay until the logged in user information is loaded. I would like to defer the apps readiness until the user is retrieved. I have this in a custom-session initializer. import Session from 'simple-auth/session'; export default { name: 'custom-session', initialize: function(container,

ember-simple-auth: Any way to get session from within the Router?

久未见 提交于 2019-12-10 20:50:05
问题 I want to use analytics tracking on every transition like mentioned in Mixpanel with EmberJS In order to do so, I need to be able to reopen the Router . Is there any way with ember-simple-auth to get the current session there? My understanding was that it's available to all the routes and controllers, but saw no mention of the Router specifically. EDIT : An alternative approach I'm exploring right now is to include a mixin on all the routes where I want to do analytics identification. I have

Facebook login with Torii and Simple-Auth : no authentication data returned

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 16:31:51
问题 I tried to setup a facebook login using Torii and Simple-Auth Torii authenticator. I am using ember-cli. Here is my configuration : // config/environment.js ENV['torii'] = { providers: { 'facebook-oauth2': { apiKey: 'my facebook app id' } } } Here is my login code : // app/controllers/login.js import Ember from 'ember'; import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin'; export default Ember.Controller.extend(LoginControllerMixin, { actions: { authenticateWithTorii:

setting the access token on every ajax request

帅比萌擦擦* 提交于 2019-12-08 12:15:27
问题 I'm using the new version of ember-simple-auth, which doesn't automatically anymore add access token to ajax requests that are sent to the server. I'm using oauth2 authentication, and due to a bad documentation I somehow cannot figure out what and where it would be the right way to set the header token for each ajax request that I do. Should this code be under the authorize function of the custom authorizer or somewhere else? this.get('session').authorize('authorizer:some-authorizer',

Ember Cli Authentication with node server and social logins

血红的双手。 提交于 2019-12-08 10:59:48
问题 I am building a ember cli app and I would like to know what is the best approach for user authentication and authorization. I fiddled around with https://github.com/simplabs/ember-simple-auth https://github.com/simplabs/ember-simple-auth/tree/master/packages/ember-simple-auth-torii along with it for social auth like facebook and gmail. But what happens is client(emberjs) sends request to facebook/gmail app and gets back a token. But this token is on the client side and my server does not know

How to use existing server token with emberjs simple auth

心不动则不痛 提交于 2019-12-08 04:11:13
问题 I'm currently implementing this library ember-simple-auth to manage authentication in the emberjs application (shopping cart) that I am currently building. The difficulty that I encounter is that the library manages authentication rules after logging in very well but not before logging in. So here is the scenario: The application must talk to the backend server to retrieve a session token for every user. This is necessary so that the user can save their items temporarily in the server side

ember-simple-auth, acceptance tests and waiting for async actions

爷,独闯天下 提交于 2019-12-07 12:18:45
问题 Struggling with acceptance tests. Started with basic login test: import { test } from 'qunit'; import moduleForAcceptance from 'static/tests/helpers/module-for-acceptance'; moduleForAcceptance('Acceptance | authentication'); test('login', function(assert) { visit('/'); click('.nav-bar__login-link'); andThen(function() { assert.notOk(find('.login-form__submit-button').attr('disabled')); }); fillIn('.login-form__email-block input', "ruz@email.com"); fillIn('.login-form__password-block input',

Ember-Simple-Auth with Torii access user info

岁酱吖の 提交于 2019-12-07 02:21:27
I've been working all week to get authentication working. I have gotten it working with Ember-CLI Ember-Simple-Auth Torii google-oauth2 provider However I have proven unsuccessful in getting the users information from google. I have tried creating a torii-adapter as stated in their documentation but it doesn't appear to be called // app/torii-adapters/application.js export default Ember.Object.extend({ open: function(authorization){ console.log('authorization from adapter', authorization); } }); I've exhausted my google-foo and am asking for your assistance. This is a great library combination

ember-simple-auth, acceptance tests and waiting for async actions

风格不统一 提交于 2019-12-05 21:51:19
Struggling with acceptance tests. Started with basic login test: import { test } from 'qunit'; import moduleForAcceptance from 'static/tests/helpers/module-for-acceptance'; moduleForAcceptance('Acceptance | authentication'); test('login', function(assert) { visit('/'); click('.nav-bar__login-link'); andThen(function() { assert.notOk(find('.login-form__submit-button').attr('disabled')); }); fillIn('.login-form__email-block input', "ruz@email.com"); fillIn('.login-form__password-block input', "qwe"); click('.login-form__submit-button'); andThen(function() { console.log("ftw"); assert.equal(find(