mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-09 20:12:10 +10:00
28 lines
593 B
TypeScript
28 lines
593 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 re-use 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",
|
|
profilePicture: "",
|
|
},
|
|
update: {
|
|
admin: true,
|
|
authMecs: { set: [] },
|
|
clients: { set: [] },
|
|
},
|
|
});
|
|
});
|