providers/mastodon
MastodonProfile
扩展
Record<string,any>
属性
acct
acct: string;头像
avatar: string;avatar_static
avatar_static: string;机器人
bot: boolean;创建时间
created_at: string;显示名称
display_name: string;关注者数量
followers_count: number;关注数量
following_count: number;标题
header: string;header_static
header_static: string;ID
id: string;最后状态时间
last_status_at: null | string;已锁定
locked: boolean;备注
note: string;状态数
statuses_count: number;URL
url: string;用户名
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 规范。
由于 Mastodon 的基础设施是一个联邦宇宙,您必须定义要连接到的 issuer。
💡
Mastodon 提供商附带 默认配置。要为您的用例覆盖默认值,请查看 自定义内置 OAuth 提供商。
类型参数
| 类型参数 |
|---|
P extends MastodonProfile |
参数
| 参数 | 类型 |
|---|---|
options | OAuthUserConfig<P> & { issuer: string; } |
返回
OAuthConfig<P>