Notice the sub field? Idk where thats coming from. Its not declared anywhere in my users collection. I have tried the following
- Deleting my entire postgresql db
- Altering the users table to remove the sub field
- Deleting the users stuff, and recreating it
Users/index.ts
import type { CollectionConfig } from 'payload'
import { adminField } from '@/access/admin'
import { GravatarField } from '@/fields/gravatar'
import { authenticated } from '../../access/authenticated'
export const Users: CollectionConfig = {
slug: 'users',
access: {
admin: authenticated,
create: authenticated,
delete: authenticated,
read: authenticated,
update: authenticated,
},
admin: {
defaultColumns: ['name', 'email'],
useAsTitle: 'name',
},
auth: true,
fields: [
{
name: 'name',
type: 'text',
required: true,
},
{
name: 'role',
type: 'select',
required: true,
access: {
create: adminField,
update: adminField,
},
options: [
{ label: 'Admin', value: 'admin' },
{ label: 'Editor', value: 'editor' },
{ label: 'Website', value: 'website' },
],
defaultValue: 'editor',
},
{
name: 'allowPasswordLogin',
type: 'checkbox',
required: true,
defaultValue: false,
access: {
create: adminField,
update: adminField,
},
},
GravatarField,
],
timestamps: true,
}
GravatarField.tsx
import { Field } from 'payload'
export const GravatarField: Field = {
name: 'gravatarEmail',
type: 'text',
admin: {
position: 'sidebar',
components: {
Field: '../components/ui/gravatar.tsx#Select',
},
},
required: false,
localized: false,
}
I am really confused why its broken xD
Also im using the oauth2 plugin