Implement authentication and authorisation mechanisms using Remix full-stack capabilities. This will allow users to securely log in and access protected resources through a dedicated middleware which will be provided by Remix-auth package.
Requirements
User Registration
Create route with correct validations.
Hash passwords before storing them in the database.
Store User id in a secure cookie.
User Login
Create route with correct validations.
Validate user credentials.
Generate cookie with User id
Protected Routes
Protect routes with Remix-auth built in methods.
Ensure only authenticated users can access these routes.
Logout
Invalidate the session cookie on the client side.
Steps to Implement
User Registration Endpoint
[x] Create a registration endpoint (/signup).
[x] Hash the user’s password using bcrypt.
[x] Store the user information in simulated database.
[x] Generate a session cookie with User id.
User Login Endpoint
[x] Create a login endpoint (/login).
[x] Validate the user credentials.
[x] Generate a session cookie with User id.
Protecting Routes
[x] Apply Remix-auth middleware to routes that require authentication.
[x] Ensure unauthorised requests receive an appropriate response.
Logout Functionality
[x] Implement client-side logout functionality in the web application.
[x] Ensure the cookie is removed upon logout.
Documentation and Testing
[ ] Document relevant methods.
[ ] Write tests for the registration, login, and JWT verification processes.
Updated ticket to include Remix-auth for session authentication and remove JWT.
Remix-auth supports OAuth/Auth0 strategy if we want to update in the future
Implement authentication and authorisation mechanisms using Remix full-stack capabilities. This will allow users to securely log in and access protected resources through a dedicated middleware which will be provided by Remix-auth package.
Requirements
User Registration
User Login
Protected Routes
Logout
Steps to Implement
User Registration Endpoint
/signup
).User Login Endpoint
/login
).Protecting Routes
Logout Functionality
Documentation and Testing
Resources
Acceptance Criteria
Additional Information