跳至內容
從 NextAuth.js v4 遷移?請閱讀 我們的遷移指南.

providers/osu

內建 osu! 整合。

OsuProfile

繼承自

屬性

avatar_url

avatar_url: string;
繼承自

OsuUserCompact.avatar_url

country

country: {
  code: string;
  name: string;
};
code
code: string;
name
name: string;

country_code

country_code: string;
繼承自

OsuUserCompact.country_code

cover

cover: {
  custom_url: null | string;
  id: null | number;
  url: string;
};
custom_url
custom_url: null | string;
id
id: null | number;
url
url: string;

default_group

default_group: string;
繼承自

OsuUserCompact.default_group

discord

discord: null | string;

has_supported

has_supported: boolean;

id

id: number;
繼承自

OsuUserCompact.id

interests

interests: null | string;

is_active

is_active: boolean;
繼承自

OsuUserCompact.is_active

is_bot

is_bot: boolean;
繼承自

OsuUserCompact.is_bot

is_deleted

is_deleted: boolean;
繼承自

OsuUserCompact.is_deleted

is_online

is_online: boolean;
繼承自

OsuUserCompact.is_online

is_restricted

is_restricted: boolean;

is_supporter

is_supporter: boolean;
繼承自

OsuUserCompact.is_supporter

join_date

join_date: Date;

kudosu

kudosu: {
  available: number;
  total: number;
};
available
available: number;
total
total: number;

last_visit

last_visit: null | Date;
繼承自

OsuUserCompact.last_visit

location

location: null | string;

max_blocks

max_blocks: number;

max_friends

max_friends: number;

職業

occupation: null | string;

遊玩模式

playmode: string;

遊玩風格

playstyle: string[];

僅限好友私訊

pm_friends_only: boolean;
繼承自

OsuUserCompact.pm_friends_only

發文數

post_count: number;

個人檔案顏色

profile_colour: null | string;
繼承自

OsuUserCompact.profile_colour

個人檔案排序

profile_order: string[];

標題

title: null | string;

標題網址

title_url: null | string;

推特

twitter: null | string;

使用者名稱

username: string;
繼承自

OsuUserCompact.username

網站

website: null | string;

OsuUserCompact

擴展自

屬性

頭像網址

avatar_url: string;

國家代碼

country_code: string;

預設群組

default_group: string;

ID

id: number;

是否啟用

is_active: boolean;

是否為機器人

is_bot: boolean;

是否已刪除

is_deleted: boolean;

是否在線

is_online: boolean;

是否為贊助者

is_supporter: boolean;

上次訪問時間

last_visit: null | Date;

僅限好友私訊

pm_friends_only: boolean;

個人檔案顏色

profile_colour: null | string;

使用者名稱

username: string;

預設值()

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

將 osu! 登入功能加入您的頁面。

設定

回調網址

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

組態設定

import { Auth } from "@auth/core"
import Osu from "@auth/core/providers/osu"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    Osu({ clientId: OSU_CLIENT_ID, clientSecret: OSU_CLIENT_SECRET }),
  ],
})

資源

注意事項

預設情況下,Auth.js 假設 Osu 提供者基於 OAuth 2 規範。

osu! 不提供使用者電子郵件。

💡

osu! 提供者帶有預設組態。若要覆寫您使用案例的預設值,請查看自訂內建 OAuth 提供者

免責聲明 如果您認為在預設組態中發現錯誤,可以開啟一個問題

Auth.js 嚴格遵守規範,並且不對提供者任何偏離規範的行為負責。您可以開啟一個問題,但如果問題是不符合規範,我們可能不會尋求解決方案。您可以在討論區中尋求更多幫助。

型別參數

型別參數
P 繼承自 OsuProfile

參數

參數型別
選項OAuthUserConfig<P>

返回

OAuthConfig<P>

Auth.js © Balázs Orbán 和團隊 -2024