Sunday, August 2, 2015

Meteor User Account Management

In my last post I showed how to use routing in meteor application. In this post I will show how to implement user management in meteor application.
First install accounts-password package. This has accounts management implemented functions.
Then create signIn and signUp templates.
Then add routing paths for those.
Add signUp.js file and content should be like below. In here I have defined submit handle in onRendered function rather than implementing it in Template.event.
Then add nav.html template and content should be like below.
Add nav.js file and it's content should be like below.
Then main.html file should refactored like below.
Add sigIn.js file and content should be like below.
In nav.html, though we hide navigation menu item for students/create page for not logged user, he/she can type URL and access the page. To secure this, in routes.js, modify createStudent route.
Browse for student list page. You will see five rows order by first name.
Download source code from github.

No comments:

Post a Comment