The Login module provides a standardized method for implementing secure user identification workflows for web apps.
Using the Login module, you're able to start implementing a secure password-based user authentication mechanism to your app.
Instead of implementing a complete user authentication workflow, the Login module provides you a standardized method that you can adopt to create your authentication workflow, where things like the login form, the user database structure or the logout button are still up to you to implement to your liking.
Let's imagine we have in our database the following table called users, where we store all the users of our app, along with their login credentials:
The unique id to identify users.
The name of the user.
The email of the user.
The hashed password.
Creating the User class
First thing to do is creating a class to represent a user in our app. This class must extend the LoginUser class, which in turn also extends the Item class just as we learned in the Items guide, so it will be also the Item class that will represent an individual user in your app. Our User class will start looking like this: