Cleanup mailPasswords when oidc client is removed not only when an app is uninstalled
This commit is contained in:
@@ -54,10 +54,17 @@ async function del(clientId, userId) {
|
||||
if (result.affectedRows !== 1) throw new BoxError(BoxError.NOT_FOUND, 'mail password not found');
|
||||
}
|
||||
|
||||
async function purgeByClientId(clientId) {
|
||||
assert.strictEqual(typeof clientId, 'string');
|
||||
|
||||
await database.query('DELETE FROM mailPasswords WHERE clientId = ?', [ clientId ]);
|
||||
}
|
||||
|
||||
export default {
|
||||
get,
|
||||
getByUserId,
|
||||
add,
|
||||
list,
|
||||
del
|
||||
del,
|
||||
purgeByClientId,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user