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

GitLab 提供者

資源

設定

回調 URL

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

環境變數

AUTH_GITLAB_ID
AUTH_GITLAB_SECRET

組態

/auth.ts
import NextAuth from "next-auth"
import GitLab from "next-auth/providers/gitlab"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [GitLab],
})

注意事項

  • 如果您想在註冊時儲存使用者的電子郵件地址,請在範圍中啟用 read_user 選項。
Auth.js © Balázs Orbán 和團隊 -2024