Meteor useraccounts:带有flowrouter

时间:2016-05-18 21:00:22

标签: meteor user-accounts flow-router meteor-useraccounts

仍然在流星的新开始,我在设置useraccounts时遇到麻烦:使用flowrouter引导程序。 到目前为止,我正在使用accounts-ui进行原型设计,并且完美无缺。

然后我修改了以下软件包:

remove accounts-ui
add useraccounts:bootstrap
add useraccounts:flow-routing

我(还)还有:

accounts-password
kadira:flow-router
arillo:flow-router-helpers

控制台中似乎没有任何错误,关于任何最终丢失的包。 如果您需要了解我正在使用的套餐,请告知我们。

我的问题是: 当我尝试转到路由localhost:3000/signinjoin时,它会加载几秒钟,然后将我重定向到localhost:3000,而不显示任何与auth相关的内容。 我认为可能是我的路线错了。

这里是:

FlowRouter.route('/', {
  name: 'App.home',
  action(params, queryParams) {
    BlazeLayout.render('App_body', {main: 'signin'});
  },
});

AccountsTemplates.configure({
  showForgotPasswordLink: true,
  defaultTemplate: 'Auth_page',
  defaultLayout: 'App_body',
  defaultContentRegion: 'main',
  defaultLayoutRegions: {}
});


// Define these routes in a file loaded on both client and server
AccountsTemplates.configureRoute('signIn', {
  name: 'signin',
  path: '/signin'
});

AccountsTemplates.configureRoute('signUp', {
  name: 'join',
  path: '/join'
});

AccountsTemplates.configureRoute('forgotPwd');

AccountsTemplates.configureRoute('resetPwd', {
  name: 'resetPwd',
  path: '/reset-password'
});

注意:" /"上面的路线是我的最后一次试验,直接链接到登录路线。没有成功。

此外,当我尝试插入{{> atForm}}没有显示,但我看到用class="at-form"创建了一个空div。

真的很感激这方面的一些帮助,现在真的被困住了。

1 个答案:

答案 0 :(得分:0)

嗯,好吧。找到答案,可能对像我这样的初学者有用。 我仍然登录(当我使用account-ui时),这就是为什么它不会显示任何登录或注册模板的原因。 清除浏览器缓存(将我退出)后,它解决了问题。

我现在可以看到登录和注册表单。