protect admin account from disabling
This commit is contained in:
parent
90b338f7e4
commit
e3aa537898
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,9 @@ export class UserEndpoint extends ScimEndpoint implements IScimEndpoint {
|
|||
|
||||
public async _put(ctx: Context): Promise<IApiResponse> {
|
||||
const u = SCIMUser.fromPlain(ctx.content());
|
||||
if (ctx.id() === (await ctx.rc.getUserId())) {
|
||||
u.active = true;
|
||||
}
|
||||
const o = await ctx.rc.user.update({
|
||||
userId: ctx.id(),
|
||||
data: {
|
||||
|
|
Reference in a new issue