从1.0升级到1.2.1后,我的流星项目遇到了问题。该问题显示为forgotPwd route configured but showForgotPasswordLink set to false
。但是当我在AccountsTemplates.configure(packages\telescope-core\lib\config.js)
中签入时,showForgotPasswordLink的值本身就是true。
有人对这个问题有想法吗?
提前致谢
最佳答案
我假设您的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 add-on for User Accounts documentation:
注意:某些路由需要设置其他用户帐户的常规选项
提前。请确保打给您
在您调用之后,将执行AccountsTemplates.configureRoute
常规AccountsTemplates.configure
因此,您需要将
AccountsTemplates.configureRoute
放在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');