Make sure to delete SSO ID doc as well (#14307)

This commit is contained in:
melohagan 2024-08-05 12:54:36 +01:00 committed by GitHub
parent 374a1ba871
commit f07ebc18db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -48,10 +48,13 @@ async function removeTenantUsers(tenantId: string) {
try {
const allUsers = await getTenantUsers(tenantId)
const allEmails = allUsers.rows.map((row: any) => row.doc.email)
const allSsoIds = allUsers.rows
.map((row: any) => row.doc.ssoId)
.filter(id => !!id)
// get the id and email doc ids
let keys = allUsers.rows.map((row: any) => row.id)
keys = keys.concat(allEmails)
keys = keys.concat(allEmails).concat(allSsoIds)
const platformDb = platform.getPlatformDB()