{"repo":"MiladJoodi/Next-Fullstack-Auth","free":true,"listed":false,"github":"https://github.com/MiladJoodi/Next-Fullstack-Auth","clone":"git clone https://github.com/MiladJoodi/Next-Fullstack-Auth.git","description":"A Next.js 15 project implementing secure user authentication with JWT, refresh tokens, and protected routes. Includes full client-side forms for registration and login, server-side token verification, and dashboard access control.","language":"TypeScript","stars":14,"topics":["access-token","argon2","fullstack","jose","mongodb","nextjs","prisma","prisma-orm","react","react-hook-form"],"license":null,"category":"auth-billing-email","readme_excerpt":"Next Fullstack Auth This is a simple authentication system built with Next.js 15 App Router , TypeScript , Prisma , and JWT . It demonstrates a modern approach to secure login, registration, and protected routes using server-side logic and refresh tokens. --- Libraries & Tools Used - Frontend: Next.js 15, React, TypeScript, react-hook-form, Zod, axios - Backend: Next.js API routes, Prisma / MongoDB - Security: argon2 for password hashing, jose for JWT handling, HttpOnly cookies - UI: Tailwind CSS --- Features Implemented So Far - User Registration - Users can register with name , email , and password . - Passwords are securely hashed using argon2 . - Email is normalized to lowercase to avoid case-sensitivity issues. - Validations are enforced with Zod . - On success, the user is redirected to the Login page. - User Login - Users can log in using email and password. - Passwords are verified using argon2 . - Upon successful login: - An access token (15 min) and a refresh token (7 days) are generated using jose . - Refresh token is saved in the database. - Refresh token is stored as an HttpOnly cookie . - Old refresh tokens for the user are automatically deleted. - Login form validation using react-hook-form + Zod . - After login, the user is redirected to the Dashboard . - Logout - Removes refresh token from the database. - Clears the refresh token cookie. - Protected Routes - /dashboard and other sensitive pages require login. - Middleware verifies the refresh token before acc","default_branch":null,"files":null,"tree":[],"storefront":"/r/MiladJoodi","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MiladJoodi/Next-Fullstack-Auth/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}