Files
drop/server/plugins/01.system-init.ts
luzpaz a435ead916 Fix various typos (#156)
Found via `codespell -q 3 -S "./yarn.lock" -L pris`
2025-08-01 21:53:31 +10:00

28 lines
600 B
TypeScript

import prisma from "~/server/internal/db/database";
export default defineNitroPlugin(async (_nitro) => {
// Ensure system user exists
// The system user owns any user-based code
// that we want to reuse for the app
// e.g. notifications
await prisma.user.upsert({
where: {
id: "system",
},
create: {
id: "system",
admin: true,
displayName: "System",
username: "system",
email: "system@drop",
profilePictureObjectId: "",
},
update: {
admin: true,
authMecs: { set: [] },
clients: { set: [] },
},
});
});