2

我在这里遵循示例,我的config/environment.js文件中有这个:

ENV['simple-auth'] = {
  authorizer: 'simple-auth-authorizer:devise',
  routeAfterAuthentication: 'landing-pages'
};

但是,在我的应用程序进行身份验证后,它会尝试前往该index路线。我通过在库的方法中添加断点来确认使用的配置变量index作为属性。routeAfterAuthenticationsessionAuthenticationSucceeded

我尝试importenvironment.js文件 ES6 样式中配置配置,但这似乎不可能。

4

2 回答 2

1

Ember Simple Auth 实际上仍然依赖于window.ENV配置变量,因此您需要将其添加到您的配置中。像这样做:

  window.MyAppENV = {{ENV}};
+ window.ENV = window.MyAppENV;
  window.EmberENV = window.MyAppENV.EmberENV;
于 2014-07-19T22:33:44.457 回答
0

当与Ember CLI Simple Auth插件一起使用时,Ember Simple Auth 使用如下ENV['simple-auth']配置集config/environment.js

...

  var ENV = {
    ...
  };

  ENV['simple-auth'] = {
    routeAfterAuthentication: 'some.route.name.you.choose'
  };

  ...
于 2015-07-07T14:54:37.150 回答