{"repo":"PepeGonzale/nuxt3-auth-jwt-example","free":true,"listed":false,"github":"https://github.com/PepeGonzale/nuxt3-auth-jwt-example","clone":"git clone https://github.com/PepeGonzale/nuxt3-auth-jwt-example.git","description":"Authentication system using Nuxt3 and jsonwebtokens.","language":"Vue","stars":35,"topics":["nuxt3","typescript","jsonwebtoken","tailwindcss","nuxt","auth","open-source","javascript","vue","authentication"],"license":null,"category":"auth-billing-email","readme_excerpt":"Sentinel — Nuxt 3 JWT Auth Example A complete, production-patterned authentication reference built with Nuxt 3 , JWT , and role-based access control . This project is not a library or a starter template — it is an educational reference that shows you exactly how to wire up secure authentication in a real Nuxt 3 application. In-memory storage by design. Users reset on every server restart. This keeps the codebase focused on authentication patterns, not database setup. --- What you will learn - How to issue and verify JWTs using httpOnly cookies (not localStorage) - How to build Nuxt route middleware for guest-only, user-only, and admin-only guards - How server middleware populates user context on every API request - How to manage global auth state with useState composables - How to implement role-based access control (RBAC) with two roles: user and admin - How to hydrate the client session from a cookie on page load without exposing the token --- Quick start Open http://localhost:3000. Use the demo credentials shown on the login page. Environment variables In production, always set TOKEN SECRET to a cryptographically random string. Never use the default. Demo credentials Role Email Password ------- ------------------- ------------ User user@gmail.com password Admin admin@gmail.com password --- How the auth system works 1. Token storage — httpOnly cookie, not localStorage When a user logs in or registers, the server signs a JWT and sets it as an httpOnly cookie : This means the","default_branch":null,"files":null,"tree":[],"storefront":"/r/PepeGonzale","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/PepeGonzale/nuxt3-auth-jwt-example/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."}