From 5203c249c68a840c34f9218f230b66fe46878acd Mon Sep 17 00:00:00 2001 From: rob Date: Sat, 5 Nov 2022 05:56:36 -0400 Subject: [PATCH] emit event when removing OAuth2Client record --- app/services/oauth2.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/services/oauth2.js b/app/services/oauth2.js index 2e886b8..4608d05 100644 --- a/app/services/oauth2.js +++ b/app/services/oauth2.js @@ -464,6 +464,10 @@ class OAuth2Service extends SiteService { * @param {OAuth2Client} client the client to be removed */ async removeClient (client) { + // provides opportunity to allow or disallow and, if allowed, perform any + // additional cleanup needed when removing a client. + await this.emitDtpEvent('client.remove', client); + this.log.info('removing client', { clientId: client._id, }); await OAuth2Client.deleteOne({ _id: client._id }); }