0.3.3 • Published 3 years ago

next-auth-dynamodb v0.3.3

Weekly downloads
58
License
MIT
Repository
github
Last release
3 years ago

next-auth-dynamodb

A dynamodb provider for next-auth.

Coverage Status

Features

  • Saving and retrieving of sessions from dynamodb
  • Seeding of sessions for tests
  • Retrieving of full linked provider information for a user

Debugging

Debug logging is built in and to enable it set the environment variable NEXT_AUTH_DYNAMODB_DEBUG to any value. This will return detailed information including the method called and additional information appropriate for that method.

Example config

To use next-auth-dynamodb you need to provide it as an adapter in the next-auth config.

Here is an example config for use with GitHub login.

import { NextApiRequest, NextApiResponse } from "next";
import NextAuth, { InitOptions } from "next-auth";
import Providers from "next-auth/providers";
import NextAuthDynamodb from "next-auth-dynamodb";

const options: InitOptions = {
  debug: Boolean(process.env.NEXT_AUTH_DEBUG),
  providers: [
    Providers.GitHub({
      clientId: process.env.GITHUB_CLIENT_ID!,
      clientSecret: process.env.GITHUB_CLIENT_SECRET!,
      scope: "user",
    }),
  ],
  adapter: NextAuthDynamodb,
  session: {
    jwt: false,
  },
};

export default (req: NextApiRequest, res: NextApiResponse) =>
  NextAuth(req, res, options);

Support

next-auth-dyanmodb is provided as-is, free of charge. For support, you have a few choices:

0.3.3

3 years ago

0.3.2

3 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.1.2

4 years ago

0.2.0

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago