Cleanup mailPasswords when oidc client is removed not only when an app is uninstalled

This commit is contained in:
Johannes Zellner
2026-02-18 17:15:06 +01:00
parent 43acecfc6e
commit 0a924b2c29
3 changed files with 12 additions and 2 deletions
+8 -1
View File
@@ -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,
};