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

AccountsTemplates.configureRoute('signIn') fail - Bug in code #42

Open
haunguyen90 opened this issue May 24, 2016 · 1 comment
Open

Comments

@haunguyen90
Copy link

I'm using FlowRouter & react, and i'm encountering the issue with AccountsTemplates.configureRoute
As your instruction

// routes.jsx

AccountsTemplates.configureRoute('signIn', {
  layoutType: 'blaze-to-react',
  name: 'signin',
  path: '/login',
  template: 'myLogin',
  layoutTemplate: CustomLayout,
  layoutRegions: {
    nav: <CustomNav />,
    footer: <CustomFooter />
  },
  contentRegion: 'main'
});

But i got error Match fail, then I check the code inside this package https://github.com/meteor-useraccounts/flow-routing/blob/master/lib/core.js - line 26 & 72

var ROUTE_PAT = {
  name: Match.Optional(String),
  path: Match.Optional(String),
  template: Match.Optional(String),
  layoutTemplate: Match.Optional(String),
  renderLayout: Match.Optional(Object),
  contentRange: Match.Optional(String),
  redirect: Match.Optional(Match.OneOf(String, Match.Where(_.isFunction))),
};
AccountsTemplates.configureRoute = function(route, options) {
  check(route, String);
  check(options, Match.OneOf(undefined, Match.ObjectIncluding(ROUTE_PAT)));
  options = _.clone(options);

The problem is check(options, Match.OneOf(undefined, Match.ObjectIncluding(ROUTE_PAT)));
in ROUTE_PAT, there is a property layoutTemplate: Match.Optional(String)
but i'm using react and as your instruction for AccountsTemplates.configureRoute is layoutTemplate: CustomLayout. That's why I got error Match fail. Please fix it

@llvasconcellos
Copy link

@haunguyen90 If you know where the problem is and how to fix it why don't you send a pull request?

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