Search code examples
javascriptmeteoriron-routertelescope

Meteor upgrade issue: forgotPwd route configured but showForgotPasswordLink set to false


I am facing issue with my meteor project after upgrading 1.0 to 1.2.1. The issue says forgotPwd route configured but showForgotPasswordLink set to false. But the value of showForgotPasswordLink is true itself when i checked in AccountsTemplates.configure(packages\telescope-core\lib\config.js).

Anybody have idea on this issue?

Thanks in advance


Solution

  • I assume you have the following code in your Telescope/packages/telescope-core/lib/config.js file:

    //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
    });
    

    You receive the error forgotPwd route configured but showForgotPasswordLink set to false because the execution order is wrong.

    From the Iron Router add-on for User Accounts documentation:

    NOTE: some routes need other useraccounts' regular options to be set in advance. Please make sure to have your calls to AccountsTemplates.configureRoute be executed after your calls to the regular AccountsTemplates.configure

    As a result, you need to place your AccountsTemplates.configureRoute after 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');