In any real-world Ember application, at some point, you'll need to deal with authentication. For example, users might need to send their credentials to identify themselves to the server, or authenticated users may need access to protected parts of the application.
An important aspect of authentication is protecting information based on the logged in user. This can be done by creating sessions with the use of tokens. In this recipe, we'll create a simple token-based authentication with an Express server. This will help us understand the basics. In the next section, we'll go over using OAuth2 with Ember Simple Auth.
In a new application, generate these files:
$ ember g service session $ ember g adapter application $ ember g controller login $ ember g model student name:string age:number $ ember g route login $ ember g route students $ ember g template index $ ember g server index $ npm install body-parser –save-dev
This will generate all the scaffolding...