let's do that

This commit is contained in:
May 2024-05-23 18:25:57 +00:00 committed by GitHub
parent 87c7b3295c
commit a160ea7146
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -187,6 +187,10 @@ const validators: {
schema: AccountSchemas.Suspension.nullable(), schema: AccountSchemas.Suspension.nullable(),
validator: (actor, target, params) => { validator: (actor, target, params) => {
if (!actor.admin) return [400, "only admins can modify suspensions"] if (!actor.admin) return [400, "only admins can modify suspensions"]
if (params.suspension)
auth.AuthTokens
.filter(e => e.account == target.id)
.forEach(e => auth.invalidate(e.token))
return params.suspension || undefined return params.suspension || undefined
} }
}, },