コンテンツへスキップ
NextAuth.js v4 からの移行ですか?以下をお読みください 移行ガイド.

providers/gitlab

組み込みのGitLab統合。

GitLabProfile

拡張

プロパティ

avatar_url

avatar_url: string;

bio

bio: string;

bot

bot: boolean;

can_create_group

can_create_group: boolean;

can_create_project

can_create_project: boolean;

color_scheme_id

color_scheme_id: number;

commit_email

commit_email: string;

confirmed_at

confirmed_at: string;

created_at

created_at: string;

current_sign_in_at

current_sign_in_at: string;

email

email: string;

external

external: boolean;

extra_shared_runners_minutes_limit

extra_shared_runners_minutes_limit: number;

followers

followers: number;

following

following: number;

id

id: number;

identities

identities: {
  extern_uid: string;
  provider: string;
  }[];

job_title

job_title: string;

last_activity_on

last_activity_on: string;

last_sign_in_at

last_sign_in_at: string;

linkedin

linkedin: string;

local_time

local_time: string;

location?

optional location: string;

name

name: string;

organization

organization: string;

private_profile

private_profile: boolean;

projects_limit

projects_limit: number;

pronouns

pronouns: string;

public_email

public_email: string;

shared_runners_minutes_limit

shared_runners_minutes_limit: number;

skype

skype: string;

state

state: string;

theme_id

theme_id: number;

twitter

twitter: string;

two_factor_enabled

two_factor_enabled: boolean;

username

username: string;

web_url

web_url: string;

website_url

website_url: string;

work_information?

optional work_information: string;

default()

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

GitLabログインをページに追加します。

セットアップ

コールバックURL

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

設定

import { Auth } from "@auth/core"
import GitLab from "@auth/core/providers/gitlab"
 
const request = new Request(origin)
const response = await Auth(request, {
  providers: [
    GitLab({ clientId: GITLAB_CLIENT_ID, clientSecret: GITLAB_CLIENT_SECRET }),
  ],
})

リソース

注記

デフォルトでは、Auth.jsはGitLabプロバイダーがOAuth 2仕様に基づいていると想定します。

💡

サインアップ時にユーザーのメールアドレスを保存したい場合は、スコープ内でread_userオプションを有効にしてください。

💡

GitLabプロバイダーには、デフォルト設定が付属しています。ユースケースに合わせてデフォルトを上書きするには、組み込みOAuthプロバイダーのカスタマイズをご覧ください。

免責事項 デフォルト設定にバグがあると思われる場合は、問題を提起できます。

Auth.jsは仕様に厳密に準拠しており、プロバイダーによる仕様からの逸脱については責任を負いかねます。問題を提起できますが、問題が仕様に準拠していない場合は、解決を追求しない場合があります。ディスカッションで詳細なヘルプを求めることができます。

型パラメーター

型パラメーター
P extends GitLabProfile

パラメーター

パラメーター
optionsOAuthUserConfig<P>

戻り値

OAuthConfig<P>

Auth.js © Balázs Orbán and Team -2024