Sign-in-user component

In order to authenticate users, we have added some extra functionality to the auth service to enable us to sign in a user. Because we are not persisting the state of a user on the backend—in other words, our backend is stateless—we have to store the current state of the user on the frontend.

Remember that we created an endpoint that will issue us a token for a valid username-and-password tuple. We are going to use that endpoint to retrieve a token that will grant us access to the rest of the API endpoints.

Our sign-in component is fairly simple and it's really reused from the previous chapter, but let's refresh our memory and take a look at it. SigninComponent is found under public/src/auth/components/signin.component.ts

Get Web Application Development with MEAN now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.