0

将 1.0 升级到 1.2.1 后,我的流星项目遇到问题。问题说forgotPwd route configured but showForgotPasswordLink set to false。但是当我签入时,showForgotPasswordLink 的值本身就是 true AccountsTemplates.configure(packages\telescope-core\lib\config.js)

有人对这个问题有想法吗?

提前致谢

4

1 回答 1

1

我假设您的Telescope/packages/telescope-core/lib/config.js文件中有以下代码:

//Routes
AccountsTemplates.configureRoute('signIn');
AccountsTemplates.configureRoute('signUp', {
  path: '/register'
});
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('changePwd');
//AccountsTemplates.configureRoute('enrollAccount');
//AccountsTemplates.configureRoute('verifyEmail');


// Options
AccountsTemplates.configure({
    enablePasswordChange: true,
    showForgotPasswordLink: true,
    confirmPassword: false,
    overrideLoginErrors: true,
    lowercaseUsername: true,

    negativeFeedback: false,
    positiveFeedback: false,
    negativeValidation: true,
    positiveValidation: true
});

您收到错误forgotPwd route configured but showForgotPasswordLink set to false是因为执行顺序错误。

来自用户帐户文档的 Iron Router 插件

注意:某些路由需要提前设置其他用户帐户的常规选项。请确保在调用常规 AccountsTemplates.configure 之后执行对 AccountsTemplates.configureRoute 的调用

因此,您需要放置AccountsTemplates.configureRouteafter AccountsTemplates.configure

// Options
AccountsTemplates.configure({
  enablePasswordChange: true,
  showForgotPasswordLink: true,
  confirmPassword: false,
  overrideLoginErrors: true,
  lowercaseUsername: true,

  negativeFeedback: false,
  positiveFeedback: false,
  negativeValidation: true,
  positiveValidation: true
});

//Routes
AccountsTemplates.configureRoute('signIn');
AccountsTemplates.configureRoute('signUp', {
  path: '/register'
});
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('changePwd');
//AccountsTemplates.configureRoute('enrollAccount');
//AccountsTemplates.configureRoute('verifyEmail');

于 2015-11-19T07:51:10.920 回答