0
votes

After following the Ember-Simple-Auth-Devise installation guide, I came across the following notice on the console:

No authorizer was configured for Ember Simple Auth - specify one if backend requests need to be authorized. simple-auth.amd.js:1339

However, I do have the authorizer on the environment which makes me wonder if the culprit is where I placed the code... Also, somehow the Login/Logout on the Ember side is working without any issues.

Original Syntax found on the guide:

//config/environment.js
ENV['simple-auth'] = {
  authorizer: 'simple-auth-authorizer:devise'
}

My project environment file:

/* jshint node: true */

module.exports = function(environment) {
  var ENV = {
    modulePrefix: 'frontend',
    environment: environment,
    baseURL: '/',
    locationType: 'auto',
    EmberENV: {
      FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
      }
    },

    APP: {
      // Here you can pass flags/options to your application instance
      // when it is created
    }
  };

  if (environment === 'simple-auth') {
   authorizer: 'simple-auth-authorizer:devise'
   store: 'simple-auth-session-store:local-storage'
  }

  if (environment === 'development') {
    // ENV.APP.LOG_RESOLVER = true;
    // ENV.APP.LOG_ACTIVE_GENERATION = true;
    // ENV.APP.LOG_TRANSITIONS = true;
    // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
    // ENV.APP.LOG_VIEW_LOOKUPS = true;
  }

  if (environment === 'test') {
    // Testem prefers this...
    ENV.baseURL = '/';
    ENV.locationType = 'none';

    // keep test console output quieter
    ENV.APP.LOG_ACTIVE_GENERATION = false;
    ENV.APP.LOG_VIEW_LOOKUPS = false;

    ENV.APP.rootElement = '#ember-testing';
  }

  if (environment === 'production') {

  }

  return ENV;
};

Version Information:

DEBUG: Ember : 1.12.0

DEBUG: Ember Data : 1.0.0-beta.18

DEBUG: jQuery : 1.11.3

DEBUG: Ember Simple Auth : 0.8.0

DEBUG: Ember Simple Auth Devise : 0.8.0

1

1 Answers

0
votes

Code placement was the issue as I previously misunderstood the guides... By adding the original syntax just before return ENV the issue has been resolved. This is how my environment file looks now:

...
      if (environment === 'production') {

      }

ENV['simple-auth'] = {
  authorizer: 'simple-auth-authorizer:devise'
}
  return ENV;
};