@smarthr/next-auth
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

@smarthr/next-auth

npm version

next-auth に渡す adapter と provider を提供しているパッケージです。
adapter は redis を使用し、provider は SmarthrProvider を使用することを想定しています。

RedisAdapter には ioredis のインスタンスを渡します。

Usage

// pages/api/auth/[...nextauth].ts

import type { NextApiRequest, NextApiResponse } from 'next'
import NextAuth from 'next-auth'
import { RedisAdapter, SmarthrProvider } from '@smarthr/next-auth'

export default async function auth(req: NextApiRequest, res: NextApiResponse) {
  return NextAuth(req, res, {
    adapter: RedisAdapter(redisClient),
    provider: [
      SmarthrProvider({
        smarthrUrl: 'smarthrUrl',
        redirectUri: 'redirectUri',
        clientId: 'clientId',
        clientSecret: 'clientSecret',
      })
    ],
    // ...省略
  })
}

License

This project is licensed under the terms of the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @smarthr/next-auth

Weekly Downloads

1,098

Version

0.1.3

License

MIT

Unpacked Size

37.4 kB

Total Files

12

Last publish

Collaborators

  • shingo.sasaki
  • kesteer
  • yamish123
  • ackndev
  • ibulog
  • alpaca-tc
  • nabeliwo
  • atsushim
  • koba04
  • im36.123
  • smarthr-dev
  • ykarakita
  • cidermitaina
  • meganemura
  • wata727
  • wmoai
  • diescake
  • moshisora
  • tokky0425
  • hawaiiman
  • smarthr-admin
  • yamamoto-yuta
  • kgsi
  • otapo
  • kuny