37 lines
850 B
TypeScript
37 lines
850 B
TypeScript
import { CollectionConfig } from 'payload/types';
|
|
|
|
const Users: CollectionConfig = {
|
|
slug: 'users',
|
|
admin: {
|
|
useAsTitle: 'email',
|
|
},
|
|
access: {
|
|
read: () => true
|
|
},
|
|
auth: {
|
|
tokenExpiration: 7200, // How many seconds to keep the user logged in
|
|
verify: false, // Require email verification before being allowed to authenticate
|
|
maxLoginAttempts: 5, // Automatically lock a user out after X amount of failed logins
|
|
lockTime: 600 * 1000, // Time period to allow the max login attempts
|
|
cookies: {
|
|
secure: true,
|
|
sameSite: "lax",
|
|
domain: process.env.ASTRO_HOST
|
|
},
|
|
},
|
|
fields: [
|
|
// Email added by default
|
|
{
|
|
name: 'name',
|
|
type: 'text',
|
|
required: true
|
|
},
|
|
{
|
|
name: 'phoneNumber',
|
|
type: 'number',
|
|
required: false
|
|
}
|
|
],
|
|
};
|
|
|
|
export default Users; |