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) {
|
private async updateIsAdmin(userId: string, isAdmin?: boolean) {
|
||||||
|
if (!isAdmin) return;
|
||||||
await this.prisma.user.update({
|
await this.prisma.user.update({
|
||||||
where: {
|
where: {
|
||||||
id: userId,
|
id: userId,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
isAdmin: isAdmin === true,
|
isAdmin: isAdmin,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user