Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: no route on the client or the server for url ... /reset-password/... #11

Open
brylie opened this issue Jan 21, 2016 · 2 comments

Comments

@brylie
Copy link

brylie commented Jan 21, 2016

I am getting an error that says 'no route on the client or server' when viewing a password reset route:

Oops, looks like there's no route on the client or the server for url: "http://localhost:3000/reset-password/l3GZh7Y25xEHyExEA4HdHW4xSHNoCoErhuHpKZYMTSt." 
http://localhost:3000/reset-password/jQrANVL_hEO322VhIQwAhfah4d3d8JU1gPNVv7TJut9

I have the following configuration:

// in /client/routes/_config.js
var anonymousRoutes = [
  'login',
  'atChangePwd',
  'atEnrollAccount',
  'atForgotPwd',
  'atResetPwd',
  'atSignIn',
  'atSignUp',
  'atVerifyEmail',
  'atresendVerificationEmail'
];

// User login required for all areas of site
Router.plugin('ensureSignedIn', {except: anonymousRoutes});
// in /lib/accounts.js
AccountsTemplates.configure({
  // Behavior
  enablePasswordChange: true,
  showForgotPasswordLink: true
});

// Configure AccountsTemplates routes
AccountsTemplates.configureRoute('signIn');
AccountsTemplates.configureRoute('signUp');
AccountsTemplates.configureRoute('forgotPwd');
AccountsTemplates.configureRoute('changePwd');
AccountsTemplates.configureRoute('resetPwd');
AccountsTemplates.configureRoute('verifyEmail');

I am using iron-router, and have installed useraccounts:iron-router package.

@brylie brylie changed the title no route on the client or the server for url ... /reset-password/... Error: no route on the client or the server for url ... /reset-password/... Jan 21, 2016
@MichaelJCole
Copy link

Hey, I looked through the code and didn't notice anything. Looking at some code I'd written, here is a suggestion:

if (Meteor.isClient) {
  // Force login on routes above and listed here.
  var publicRoutes = _.pluck(AccountsTemplates.routes, 'name')
    .concat(['landing','home','privacy-policy','terms-of-service','enrollExpert']);
  Router.plugin('ensureSignedIn', { except: publicRoutes });
}

If that doesn't work, try removing the ensureSignIn plugin and see if that's the reason the route won't work.

@brylie
Copy link
Author

brylie commented Jan 22, 2016

Thanks for your help @MichaelJCole

The problem seems to have resolved itself somehow, and I am not sure what exactly changed to make it work. In other words, I still have pretty much the same code, but I moved some AccountsTemplates email configuration variables to a different file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants