Sourcebot logo
    /

    Authentication

    Public (Read-only)

    Recent Chats

    Sign in to access your chat history.

    How does authentication work in this codebase? What library is being used? What providers can a user log in with?

    Answer

    Authentication in this codebase is handled by NextAuth.js, a popular authentication library for Next.js applications. The main configuration can be found in web/src/server/auth.ts auth.ts.

    The application uses the PrismaAdapter auth.ts:8-8 to connect NextAuth.js to a Prisma database for session and user management.

    A user can log in with a variety of authentication providers, which are configured based on environment variables. The available providers are:

    • Credentials: Standard email and password authentication auth.ts:80-165.
    • Email: Passwordless login using email verification auth.ts:169-181.
    • Google: OAuth login with a Google account auth.ts:207-219.
    • GitHub: OAuth login with a GitHub account auth.ts:259-271.
    • GitHub Enterprise: OAuth login with a GitHub Enterprise account auth.ts:273-292.
    • GitLab: OAuth login with a GitLab account auth.ts:294-313.
    • Okta: SSO login with Okta auth.ts:221-238.
    • Auth0: SSO login with Auth0 auth.ts:240-257.
    • Azure Active Directory: SSO login with Azure AD auth.ts:315-332.
    • Amazon Cognito: SSO login with AWS Cognito auth.ts:334-351.
    • Keycloak: SSO login with Keycloak auth.ts:353-370.
    • WorkOS: SSO login with WorkOS auth.ts:372-383.
    • Custom SSO: A generic SSO provider that can be configured with custom details auth.ts:183-205.
    auth.ts