providers/yandex
YandexProfile
プロパティ
birthday?
optional birthday: null | string;
ユーザーの生年月日を YYYY-MM-DD 形式で表します。日付の不明な要素はゼロで埋められます(例: 0000-12-23
)。ユーザーの生年月日が不明な場合、誕生日は 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 ログインをページに追加します。
セットアップ
コールバック URL
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 プロバイダーのカスタマイズ を確認してください。
パラメーター
パラメーター | 型 |
---|---|
オプション | OAuthUserConfig <YandexProfile > |