JonatasSOliveira / nextrack

https://nextrack-two.vercel.app
0 stars 0 forks source link

Authetication block #1

Closed JonatasSOliveira closed 2 weeks ago

JonatasSOliveira commented 3 weeks ago

User Story

As a standard user of the software I want to be able to register and log into the software and also want the system to protect access to the pages So that I can access my data and private routes of the system, as well as protect access to my data from others. Currently there is no authentication protection on the system's screens.

Acceptance Criteria

1. Login Screen

A login screen must be created on the initial route ("/") of the system to log into the platform. The fields to log in must be:

Additionally, a way to access the registration screen must also be created so that the user can register if they do not have an account yet.

2. Registration Screen

A registration screen must be created on the route ("/sign-up"). To register on the platform, the following fields must be provided:

Note that a registration will only be considered valid if the "password" and "confirm password" fields have the same value.

Note: These are the initial credential fields, and more fields will be required later.

3. System Route Protection

A security model must be implemented to prevent access to other screens of the system until the user has been authenticated.

JonatasSOliveira commented 2 weeks ago

Technical Solution Implemented

1. Visual Update

Tailwind and Shadcnui were installed in the project to assist in styling the project, allowing for the creation of minimalist layouts and components more quickly than creating everything manually.

2. Screen Restyling

Using the new visual resources of the project, the login, registration, and home screens were redesigned.

3. Navigation Container

A basic container was created that includes a drawer with navigation between the main pages of the system.

4. Private Routes

Using middleware, cookies, and the Jose library, a method was implemented to protect private routes so they can only be accessed when the user is authenticated.