首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >没有为Ember-Simple-Auth问题(或bug)配置授权程序

没有为Ember-Simple-Auth问题(或bug)配置授权程序
EN

Stack Overflow用户
提问于 2015-06-29 06:20:01
回答 1查看 149关注 0票数 0

在遵循余烬-简单-8月-设计安装指南之后,我在控制台上看到了以下通知:

没有为Ember Simple配置授权器--如果后端请求需要被授权,请指定一个。simple-auth.amd.js:1339

然而,我确实拥有环境的授权人,这让我怀疑罪魁祸首是否是我放置代码的地方.另外,Ember端的Login/Logout不存在任何问题。

指南上的原始语法:

代码语言:javascript
复制
//config/environment.js
ENV['simple-auth'] = {
  authorizer: 'simple-auth-authorizer:devise'
}

我的项目环境文件:

代码语言:javascript
复制
/* 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;
};

版本信息:

调试: Ember : 1.12.0 调试:beta.18数据: 1.0.0-beta.18 调试: jQuery : 1.11.3 调试: Ember简单8月: 0.8.0 调试: Ember简单8月设计: 0.8.0

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-06-30 04:40:43

代码放置是问题,因为我之前误解了指南。通过在return ENV之前添加原始语法,问题已经得到解决。我的环境文件现在是这样的:

代码语言:javascript
复制
...
      if (environment === 'production') {

      }

ENV['simple-auth'] = {
  authorizer: 'simple-auth-authorizer:devise'
}
  return ENV;
};
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31108995

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档