diff --git a/src/modules/user/user.service.ts b/src/modules/user/user.service.ts index f13d968..8aa2809 100644 --- a/src/modules/user/user.service.ts +++ b/src/modules/user/user.service.ts @@ -59,13 +59,17 @@ export class UserService { }, }); - if (!user) + if (!user) { + const isFirstUser = (await this.prisma.user.count()) === 0; + user = await this.prisma.user.create({ data: { - providerId, username, + providerId, + role: isFirstUser ? "ADMIN" : "STUDENT", }, }); + } return user; }