Skip to content
Migrating from NextAuth.js v4? Read our migration guide.

GitLab Provider

Resources

Setup

Callback URL

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

Environment Variables

AUTH_GITLAB_ID
AUTH_GITLAB_SECRET

Configuration

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

Notes

  • Enable the read_user option in scope if you want to save the users email address on sign up.
Auth.js © Balázs Orbán and Team - 2024