providers/yandex
YandexProfile
屬性
birthday?
optional birthday: null | string;
使用者以 YYYY-MM-DD 格式表示的出生日期。日期中未知的元素將以零填入,例如:0000-12-23
。如果使用者的出生日期未知,則 birthday 將會是 null
client_id
client_id: string;
請求中發出的 OAuth 權杖的應用程式 ID。可在應用程式屬性中找到。若要開啟屬性,請按一下應用程式名稱。
default_avatar_id?
optional default_avatar_id: string;
Yandex 使用者個人資料圖片的 ID。下載使用者頭像的格式:https://avatars.yandex.net/get-yapic/<default_avatar_id>/<size>
範例
"https://avatars.yandex.net/get-yapic/31804/BYkogAC6AoB17bN1HKRFAyKiM4-1/islands-200"
Available sizes:
`islands-small`: 28×28 pixels.
`islands-34`: 34×34 pixels.
`islands-middle`: 42×42 pixels.
`islands-50`: 50×50 pixels.
`islands-retina-small`: 56×56 pixels.
`islands-68`: 68×68 pixels.
`islands-75`: 75×75 pixels.
`islands-retina-middle`: 84×84 pixels.
`islands-retina-50`: 100×100 pixels.
`islands-200`: 200×200 pixels.
default_email?
optional default_email: string;
用於聯絡使用者的預設電子郵件地址。
default_phone?
optional default_phone: {
id: number;
number: string;
};
用於聯絡使用者的預設電話號碼。API 可自行決定是否從回應中排除使用者的電話號碼。該欄位包含以下參數:id:電話號碼 ID。number:使用者的電話號碼。
id
id: number;
number
number: string;
display_name?
optional display_name: string;
emails?
optional emails: string[];
使用者電子郵件地址的陣列。目前僅包含預設電子郵件地址。
first_name?
optional first_name: string;
id
id: string;
Yandex 使用者的唯一 ID。
is_avatar_empty?
optional is_avatar_empty: boolean;
表示在 default_avatar_id
欄位中指定了樁(在 Yandex 註冊時自動指派的個人資料圖片)ID。
last_name?
optional last_name: string;
login
login: string;
使用者的 Yandex 登入名稱。
psuid
psuid: string;
已授權的 Yandex 使用者 ID。它是根據 client_id
和 user_id
配對在 Yandex 端形成的。
real_name?
optional real_name: string;
使用者在 Yandex ID 中指定的名字和姓氏。名字和姓氏的非拉丁字元以 Unicode 格式呈現。
sex?
optional sex: null | "female" | "male";
使用者性別。null
代表性別未知或未指定。如果 Yandex 未提供,則會是 undefined
。
default()
default(options): OAuthConfig<YandexProfile>
將 Yandex 登入新增至您的頁面。
設定
回調網址
https://example.com/api/auth/callback/yandex
設定
import { Auth } from "@auth/core"
import Yandex from "@auth/core/providers/yandex"
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Yandex({ clientId: YANDEX_CLIENT_ID, clientSecret: YANDEX_CLIENT_SECRET }),
],
})
資源
💡
Yandex 供應商隨附預設設定。若要覆寫您的用例的預設值,請查看自訂內建 OAuth 供應商。
參數
參數 | 類型 |
---|---|
options | OAuthUserConfig <YandexProfile > |