A plugin for Payload to easily allow for documents to be secured behind a layer of password protection.
yarn add payload-plugin-password-protection
# OR
npm i payload-plugin-password-protection
In the plugins
array of your Payload config, call the plugin with options:
import { buildConfig } from 'payload/config';
import passwordProtection from 'payload-plugin-password-protection';
const config = buildConfig({
collections: [
plugins: [
passwordProtection({
collections: ['pages'],
})
]
});
export default config;
An array of collections slugs to enable password protection.
All types can be directly imported:
import { PasswordProtectionConfig } from "payload-plugin-password-protection/dist/types";