Useraccounts:iron-routing problem to set it up

I updated my meteor app and had useraccounts on it and it suddenly told me to install the useraccounts:iron-routing to use it with Iron Router…

Installed the package and now its telling me

W20150818-19:23:20.744(-6)? (STDERR) Error: changePwd route configured but enablePasswordChange set to false!

and won’t start my app, but my AccountsTemplates.configure({ has all seted to true… here is the code:

//Routes
AccountsTemplates.configureRoute('changePwd');
AccountsTemplates.configureRoute('enrollAccount');
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('signIn');
AccountsTemplates.configureRoute('signUp');
AccountsTemplates.configureRoute('verifyEmail');

// Options


AccountsTemplates.configure({


    defaultLayout: 'layout',
    showForgotPasswordLink: true,
    overrideLoginErrors: true,
    enablePasswordChange: true,
    sendVerificationEmail: false,

    //enforceEmailVerification: true,
    //confirmPassword: true,
    //continuousValidation: false,
    //displayFormLabels: true,
    //forbidClientAccountCreation: false,
    //formValidationFeedback: true,
    //homeRoutePath: '/',
    //showAddRemoveServices: false,
    //showPlaceholders: true,

    negativeValidation: true,
    positiveValidation:true,
    negativeFeedback: false,
    positiveFeedback:true,

    // Privacy Policy and Terms of Use
    //privacyUrl: 'privacy',
    //termsUrl: 'terms-of-use',
});

AccountsTemplates.configure({
    showLabels: true,
    negativeValidation: true,
    negativeFeedback: true
});


AccountsTemplates.addField({
    _id: "username",
    type: "text",
    displayName: "username",
    required: true,
    minLength: 5,
});

AccountsTemplates.removeField('email');
AccountsTemplates.addField({
    _id: 'email',
    type: 'email',
    required: true,
    displayName: "email",
    re: /.+@(.+){2,}\.(.+){2,}/,
    errStr: 'Invalid email',
});

AccountsTemplates.removeField('password');
AccountsTemplates.addField({
    _id: 'password',
    type: 'password',
    required: true,
    minLength: 6,
    re: /(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/,
    errStr: 'At least 1 digit, 1 lowercase and 1 uppercase',
});

any help?

Thnx

Bumping this thread, need help

Does it work if you remove your re-definition of the password field?

nope, still says the same

I have the same problem by adding in HTML file. I am not sure that is the reason. It worked fine in localhost but not meteor site.

Hi all,
I’m sorry you’re getting problems with the new routing package.
The thing is that now you have to make sure to have your routes configuration after the normal options configuration.

It should be enough to move all AccountsTemplates.configureRoute calls to the bottom of the file!
Lets have a look at the note at the end of the Confguration section

Also, be sure to apply your global configuration for the Router object before you configure UserAccounts routes.
If you wish to see an example, lets have a look at how I changed the bootstrap boilerplate.

1 Like

In my case it worked fine in localhost but failed in remote server. It may be caused to find my .js code by using …/…/ relative path. If I have foo.html, foo.js and lib.js what configuration is required to work along with iron router?

I have tried following this and other pieces of advice, but I still get the above error:

Can anyone help?

Thanks!

Thank you, this helped
Adam