payload-authjs
Version:
A Payload CMS 3 plugin for Auth.js 5
45 lines (44 loc) • 1.26 kB
TypeScript
import type { NextAuthConfig } from "next-auth";
import type { CollectionSlug, Plugin } from "payload";
import type { SignInButtonOptions } from "../components/SignInButton";
export interface AuthjsPluginConfig {
/**
* Enable or disable plugin
*
* @default true
*/
enabled?: boolean;
/**
* The slug of the collection that contains the users
*
* @default "users"
*/
userCollectionSlug?: CollectionSlug;
/**
* Auth.js configuration
*
* @example
* import { config } from "./auth.config";
*
* authjsPlugin({ authjsConfig: config })
*/
authjsConfig: NextAuthConfig;
/**
* Enable the default local strategy from Payload CMS (experimental)
* @see https://payloadcms.com/docs/authentication/jwt
*
* @default false
*/
enableLocalStrategy?: boolean;
/**
* Customize the components that the plugin adds to the admin panel
*/
components?: {
/**
* Customize the SignInButton component
* Or set to `false` to disable the SignInButton component
*/
SignInButton?: SignInButtonOptions | false;
};
}
export declare const authjsPlugin: (pluginOptions: AuthjsPluginConfig) => Plugin;