Skip to content

cvega/next-auth-ioredis-adapter-example

 
 

Repository files navigation

An example of using Next Auth with ioredis library to save user data into Redis Server with IORedisAdapter.

IORedisAdapter saves data with Hash data structure instead of JSON.stringify to simplify the management of user data.

For example, a role field ("admin" | "moderator" | "user") in User object in [...nextauth].ts

Getting Started

  1. Create an .env file work the following content:

    REDIS_URL="redis://....."
    GITHUB_CLIENT_ID = ""
    GITHUB_CLIENT_SECRET = ""
    NEXTAUTH_URL="http://localhost:3000"
    NEXTAUTH_SECRET="SOME_SECRET"
    
  2. Run the server

    npm run dev
    # or
    yarn dev

About

Next Auth IORedisAdapter example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 82.5%
  • CSS 14.4%
  • JavaScript 2.1%
  • Shell 1.0%