diff --git a/payload/src/seed.ts b/payload/src/seed.ts new file mode 100644 index 0000000..dd2061b --- /dev/null +++ b/payload/src/seed.ts @@ -0,0 +1,15 @@ +import { Payload } from "payload"; +import { User } from "./payload-types"; + +export const seed = async (payload: Payload): Promise => { + // Local API methods skip all access control by default + // so we can easily create an admin user directly in init + await payload.create({ + collection: 'users', + data: { + email: 'astro@ssg.js', + password: 'password', + roles: ['ssg'] + } + }) +} \ No newline at end of file