mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 15:49:01 +02:00
Merge pull request #21031 from overleaf/msm-clean-collabratec-tokens
[web] cleanup collabratec tokens GitOrigin-RevId: 0ad73ca5d4c4c82d79e2ec7119c5b77a83b7086f
This commit is contained in:
@@ -158,4 +158,8 @@ async function _cleanupUser(user) {
|
||||
await InstitutionsAPI.promises.deleteAffiliations(user._id)
|
||||
await SubscriptionUpdater.promises.removeUserFromAllGroups(user._id)
|
||||
await UserMembershipsHandler.promises.removeUserFromAllEntities(user._id)
|
||||
await Modules.promises.hooks.fire('cleanupPersonalAccessTokens', user._id, [
|
||||
'collabratec',
|
||||
'git_bridge',
|
||||
])
|
||||
}
|
||||
|
||||
@@ -236,6 +236,17 @@ describe('UserDeleter', function () {
|
||||
).to.have.been.calledWith(this.userId)
|
||||
})
|
||||
|
||||
it('should cleanup collabratec access tokens', async function () {
|
||||
await this.UserDeleter.promises.deleteUser(this.userId, {
|
||||
ipAddress: this.ipAddress,
|
||||
})
|
||||
expect(this.Modules.promises.hooks.fire).to.have.been.calledWith(
|
||||
'cleanupPersonalAccessTokens',
|
||||
this.userId,
|
||||
['collabratec', 'git_bridge']
|
||||
)
|
||||
})
|
||||
|
||||
it('should fire the deleteUser hook for modules', async function () {
|
||||
await this.UserDeleter.promises.deleteUser(this.userId, {
|
||||
ipAddress: this.ipAddress,
|
||||
|
||||
Reference in New Issue
Block a user