mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-22 05:46:26 -08:00
let's do that
This commit is contained in:
parent
87c7b3295c
commit
a160ea7146
|
@ -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
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue