Skip to content
This repository was archived by the owner on Jun 29, 2025. It is now read-only.

Commit ccb7fdc

Browse files
committed
fix: admin role gets reset if signing in with an OIDC provider
1 parent ac81cb9 commit ccb7fdc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/src/oauth/oauth.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ export class OAuthService {
197197
}
198198

199199
private async updateIsAdmin(userId: string, isAdmin?: boolean) {
200+
if (!isAdmin) return;
200201
await this.prisma.user.update({
201202
where: {
202203
id: userId,
203204
},
204205
data: {
205-
isAdmin: isAdmin === true,
206+
isAdmin: isAdmin,
206207
},
207208
});
208209
}

0 commit comments

Comments
 (0)