コンテンツへスキップ
NextAuth.js v4からの移行?こちらを ご確認ください.

Mastodon プロバイダー

リソース

設定

コールバックURL

https://example.com/api/auth/callback/mastodon

環境変数

AUTH_MASTODON_ID
AUTH_MASTODON_SECRET
AUTH_MASTODON_ISSUER

設定

/auth.ts
import NextAuth from "next-auth"
import Mastodon from "next-auth/providers/mastodon"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [Mastodon],
})

備考

  • Mastodonのアーキテクチャ上、認証対象のインスタンスURLをissuerとして定義する必要があります。
Auth.js © Balázs Orbán and Team -2024