GitLab Provider
Resources
Setup
Callback URL
https://example.com/api/auth/callback/gitlabEnvironment Variables
AUTH_GITLAB_ID
AUTH_GITLAB_SECRETConfiguration
/auth.ts
import NextAuth from "next-auth"
import GitLab from "next-auth/providers/gitlab"
 
export const { handlers, auth, signIn, signOut } = NextAuth({
  providers: [
    // Default (gitlab.com)
    GitLab,
    // Self-hosted example
    GitLab({
      baseUrl: "https://gitlab.example.com",
    }),
  ],
})Notes
- Enable the read_useroption in scope if you want to save the users email address on sign up.