Payload Auth Plugin configuration

enabled

Type: boolean

Description: Option to either enable or disable the plugin for Payload to use.

Default: true

Optional: Yes


ts
            {
  enabled: true;
}

        

name

Type: string

Description: A unique name that can be used to create endpoints and sessions. Example: "storefront", "admin", or "console"

Optional: No


ts
            {
  name: "some-app-name";
}

        

useAdmin

Type: boolean

Description: Set to true if the plugin is to be used for admin app authentication.

Optional: Yes


ts
            {
  useAdmin: true;
}

        

usersCollectionSlug

Type: string

Description: Set the users collection slug to be used by the plugin

Optional: No


ts
            {
  usersCollectionSlug: "users";
}

        

accountsCollectionSlug

Type: string

Description: Set the accounts collection slug to be used by the plugin

Optional: No


ts
            {
  accountsCollectionSlug: "accounts";
}

        

providers

Type: Array

Description: Array of providers(OAuth, Password, and Passkey).

Optional: No


ts
            {
  providers: [
    GoogleAuthProvider({
        client_id: "GOOGLE_CLIENT_ID",
        client_secret: "GOOGLE_CLIENT_SECRET"
    }),
    PasswordProvider({
      emailTemplates: {
        forgotPassword: renderForgotPasswordTemplate,
      },
    }),
  ];
}

        

allowOAuthAutoSignUp

Type: boolean

Description: Allows automatic sign-up when using any OAuth provider.. This should be used at the admin's discretion.

Default: false

Optional: Yes


ts
            {
  allowSignUp: true;
}

        

successRedirectPath

Type: string

Description: A path to redirect the user after successful signin

Optional: No


ts
            {
  successRedirectPath: "/some-path";
}

        

errorRedirectPath

Type: string

Description: A path to redirect the user when error occurs

Optional: No


ts
            {
  errorRedirectPath: "/some-path";
}