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> {
|
public async _put(ctx: Context): Promise<IApiResponse> {
|
||||||
const u = SCIMUser.fromPlain(ctx.content());
|
const u = SCIMUser.fromPlain(ctx.content());
|
||||||
|
if (ctx.id() === (await ctx.rc.getUserId())) {
|
||||||
|
u.active = true;
|
||||||
|
}
|
||||||
const o = await ctx.rc.user.update({
|
const o = await ctx.rc.user.update({
|
||||||
userId: ctx.id(),
|
userId: ctx.id(),
|
||||||
data: {
|
data: {
|
||||||
|
|
Reference in a new issue