This project is a code example where the @edge-csrf/core library is implemented along with Next.js to generate and validate CSRF tokens.
Important files:
/src/constants.ts/src/utils/csrfTokens.ts/src/middleware.ts/src/actions/deleteCsrfCookieAction.ts/src/app/api/login/route.ts/src/app/components/Login/Login.tsx/src/app/page.tsx
👨💻 dev.to post.
🚀 Live demo here.
Install dependencies
yarn installRun the development server:
yarn devOpen http://localhost:3000 with your browser to see the result.