1
0
Fork 0
mirror of synced 2024-06-16 09:25:12 +12:00

Fix for #5522 - making sure that app roles aren't removed when an app is unpublished.

This commit is contained in:
mike12345567 2022-04-27 16:05:27 +01:00
parent 4a02f7f9aa
commit 2773c04953

View file

@ -406,11 +406,14 @@ const destroyApp = async (ctx: any) => {
if (!env.isTest() && !isUnpublish) {
await deleteApp(appId)
}
// automations only in production
if (isUnpublish) {
await cleanupAutomations(appId)
}
// make sure the app/role doesn't stick around after the app has been deleted
await removeAppFromUserRoles(ctx, appId)
// remove app role when the dev app is deleted (no trace of app anymore)
else {
await removeAppFromUserRoles(ctx, appId)
}
await appCache.invalidateAppMetadata(appId)
return result
}