From 2e445b9c5bcf60623abdfbed6d568aeb355cf437 Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Tue, 5 May 2026 07:57:16 +0200 Subject: [PATCH] feat(auth): add users collection with role + displayName fields --- .../src/integrations/cms/collections/users.ts | 26 +++++++++++++++++++ packages/auth/src/integrations/cms/index.ts | 1 + 2 files changed, 27 insertions(+) create mode 100644 packages/auth/src/integrations/cms/collections/users.ts create mode 100644 packages/auth/src/integrations/cms/index.ts diff --git a/packages/auth/src/integrations/cms/collections/users.ts b/packages/auth/src/integrations/cms/collections/users.ts new file mode 100644 index 0000000..e9f772e --- /dev/null +++ b/packages/auth/src/integrations/cms/collections/users.ts @@ -0,0 +1,26 @@ +import type { CollectionConfig } from "payload"; + +export const users: CollectionConfig = { + slug: "users", + auth: true, + admin: { + useAsTitle: "email", + }, + fields: [ + { + name: "displayName", + type: "text", + }, + { + name: "role", + type: "select", + options: [ + { label: "Admin", value: "admin" }, + { label: "Editor", value: "editor" }, + { label: "Author", value: "author" }, + ], + defaultValue: "author", + required: true, + }, + ], +}; diff --git a/packages/auth/src/integrations/cms/index.ts b/packages/auth/src/integrations/cms/index.ts new file mode 100644 index 0000000..be3aff4 --- /dev/null +++ b/packages/auth/src/integrations/cms/index.ts @@ -0,0 +1 @@ +export { users } from "./collections/users";