コンテンツへスキップ
NextAuth.js v4 からの移行ですか?こちらをご覧ください 移行ガイド.

providers/mastodon

組み込みのMastodon統合。

MastodonProfile

拡張

プロパティ

acct

acct: string;

avatar

avatar: string;

avatar_static

avatar_static: string;

bot

bot: boolean;

created_at

created_at: string;

display_name

display_name: string;

followers_count

followers_count: number;

following_count

following_count: number;
header: string;

header_static

header_static: string;

id

id: string;

last_status_at

last_status_at: null | string;

locked

locked: boolean;

note

note: string;

statuses_count

statuses_count: number;

url

url: string;

username

username: string;

default()

default<P>(options): OAuthConfig<P>

Mastodonログインをページに追加します。

セットアップ

コールバック URL

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

設定

import { Auth } from "@auth/core"
import Mastodon from "@auth/core/providers/mastodon"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Mastodon({
      clientId: MASTODON_CLIENT_ID,
      clientSecret: MASTODON_CLIENT_SECRET,
      issuer: MASTODON_ISSUER,
    }),
  ],
})

リソース

注記

デフォルトでは、Auth.jsはMastodonプロバイダーがOAuth 2仕様に基づいていると仮定します。

MastodonsのインフラストラクチャがFediverseであるため、接続先のissuerを定義する必要があります。

💡

Mastodonプロバイダーにはデフォルト設定が付属しています。ユースケースに合わせてデフォルトをオーバーライドするには、組み込みのOAuthプロバイダーのカスタマイズをご確認ください。

免責事項 デフォルト設定にバグがあると思われる場合は、問題を提起できます。

Auth.jsは仕様に厳密に従っており、プロバイダーによる仕様からの逸脱について責任を負うことはできません。問題を提起することはできますが、問題が仕様の不遵守である場合、解決を追求しない可能性があります。ディスカッションでさらにヘルプを求めることができます。

型パラメーター

型パラメーター
P extends MastodonProfile

パラメーター

パラメーター
optionsOAuthUserConfig<P> & { issuer: string; }

戻り値

OAuthConfig<P>

Auth.js © Balázs Orbán およびチーム -2024