GithubHelp home page GithubHelp logo

renanleonel / next-auth-v5-middleware Goto Github PK

View Code? Open in Web Editor NEW
27.0 1.0 5.0 139 KB

authentication with next-auth v5 using middleware

JavaScript 1.09% CSS 9.95% TypeScript 88.95%
next-auth next-auth-v5 nextjs

next-auth-v5-middleware's Introduction

NextAuth v5 - Middleware Authentication

Key Features:

  • Next.js 14
  • Next Auth v5 (Auth.js)
  • Credentials Provider
  • Protected routes & redirect if logged
  • Server Actions
  • Forms
  • useFormState hook
  • Server-side form validation with zod
  • Unit and Integration tests
  • Complete test setup for Next Auth
  • Mocks of server actions and useFormState hook

This repository serves as an example of how to implement an authentication flow with middleware using next-auth v5. this repo also contains the necessary configs to setup a test environment for next-auth v5 using jest/testing-library, also containing examples of how to mock a server action and the useFormState hook.

This repository uses react and react-dom in canary versions.

Cloning the repository

git clone https://github.com/renanleonel/next-auth-v5-middleware.git

Install packages

pnpm i

Start application

pnpm run dev

next-auth-v5-middleware's People

Contributors

renanleonel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.