سؤال

I'm trying to figure out how to use accounts-entry with my meteor project. I had to delete all of my sign up and sign in forms because it got so confusing that I had to start over. How can I set it up so that there is a sign up and sign in form on the home page, and when you sign up/sign in, it redirects the user to their personal dashboard page? And when they are already signed in when they go to the home page it automatically redirects them to their dashboard as well?

هل كانت مفيدة؟

المحلول

Accounts-entry will give you /sign-up and /sign-in out of the box. If you want to render the forms elsewhere you can try including the templates in your own templates {{> entrySignIn}} and {{> entrySignUp}}.

Also if you haven't seen it yet, the official documentation is at http://github.differential.com/accounts-entry/

If you want to redirect someone from a page to the dashboard if they are logged in already you can check when your template renders if Meteor.user() exists then use iron-routers Router.go('dashboard').

Hope that helps!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top