providers/twitch
TwitchProfile
扩展
Record<string,any>
属性
email: string;picture
picture: string;preferred_username
preferred_username: string;sub
sub: string;default()
default(config): OIDCConfig<TwitchProfile>在您的页面中添加 Twitch 登录。
设置
回调 URL
https://example.com/api/auth/callback/twitch配置
import { Auth } from "@auth/core"
import Twitch from "@auth/core/providers/twitch"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Twitch({ clientId: TWITCH_CLIENT_ID, clientSecret: TWITCH_CLIENT_SECRET }),
],
})资源
将以下重定向 URL 添加到控制台 http://<your-next-app-url>/api/auth/callback/twitch
注意事项
默认情况下,Auth.js 假设 Twitch 提供商基于 Open ID Connect 规范。
💡
Twitch 提供商附带一个 默认配置。要覆盖您的用例的默认值,请查看 自定义内置 OAuth 提供商。
参数
| 参数 | 类型 |
|---|---|
config | OIDCUserConfig<TwitchProfile> |