mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-16 01:31:19 +10:00
29 lines
670 B
TypeScript
29 lines
670 B
TypeScript
import { applicationSettings } from "../internal/config/application-configuration";
|
|
import prisma from "../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: [] },
|
|
},
|
|
});
|
|
});
|