fix: admin role gets reset if signing in with an OIDC provider
This commit is contained in:
@@ -197,12 +197,13 @@ export class OAuthService {
|
||||
}
|
||||
|
||||
private async updateIsAdmin(userId: string, isAdmin?: boolean) {
|
||||
if (!isAdmin) return;
|
||||
await this.prisma.user.update({
|
||||
where: {
|
||||
id: userId,
|
||||
},
|
||||
data: {
|
||||
isAdmin: isAdmin === true,
|
||||
isAdmin: isAdmin,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user