I was tasked with building a web application to manage basic authentication. To meet this requirement, I opted to use Next.js and TypeScript, ensuring support for both server-side and client-side rendering and strong typing.
Authentication and session management were implemented using NextAuth library, utilizing JWT tokens with a maximum age of 3 minutes, users can renew their tokens with a single click; however, if the time elapses, they will prompted to reauthenticate.
Notably, the application's UI matches that of InCard.
Note
For Authentication you can use the following for both username and password:
incard
-
โ Includes at least two pages: login and home.
-
โ Ensures functionality (e.g., successful login redirects users to the home page).
-
โ Implements modern form validation.
-
โ Handles errors effectively (e.g., incorrect details entered or session expiry).
-
โ Fully responsive website.
-
โ Deployed version of the solution.
-
โ Supports both Server-Side Rendering (SSR) and Client-Side Rendering (CSR).
-
โ Maintains persistent session (login status retained on page reload).
-
โ Provides both protected & unprotected pages.
-
โ Automatically redirects to the login page upon session expiry.
-
โ Includes a suite of demo unit and integration tests.
-
โ Mimics InCard authentication and home page styles.
-
โ Includes toast notifications for user-friendly feedback.
-
๐จโ๐ป Includes a suite of demo end-to-end tests.