diff --git a/app/gen-server/lib/Doom.ts b/app/gen-server/lib/Doom.ts index 283a42c5..cbce2587 100644 --- a/app/gen-server/lib/Doom.ts +++ b/app/gen-server/lib/Doom.ts @@ -117,8 +117,7 @@ export class Doom { await this._notifier.deleteUser(userId); // Remove user from cognito - const fullUser = this._dbManager.makeFullUser(user); - await this._loginSystem.deleteUser(fullUser); + await this._loginSystem.deleteUser(user); // Remove user from our db await this._dbManager.deleteUser({userId}, userId); diff --git a/app/server/lib/GristServer.ts b/app/server/lib/GristServer.ts index 7ba31c38..6cff9863 100644 --- a/app/server/lib/GristServer.ts +++ b/app/server/lib/GristServer.ts @@ -1,7 +1,8 @@ import { GristDeploymentType, GristLoadConfig } from 'app/common/gristUrls'; -import { FullUser, UserProfile } from 'app/common/UserAPI'; +import { UserProfile } from 'app/common/UserAPI'; import { Document } from 'app/gen-server/entity/Document'; import { Organization } from 'app/gen-server/entity/Organization'; +import { User } from 'app/gen-server/entity/User'; import { Workspace } from 'app/gen-server/entity/Workspace'; import { Activations } from 'app/gen-server/lib/Activations'; import { HomeDBManager } from 'app/gen-server/lib/HomeDBManager'; @@ -57,7 +58,7 @@ export interface GristServer { export interface GristLoginSystem { getMiddleware(gristServer: GristServer): Promise; - deleteUser(user: FullUser): Promise; + deleteUser(user: User): Promise; } export interface GristLoginMiddleware { diff --git a/app/server/lib/SamlConfig.ts b/app/server/lib/SamlConfig.ts index bc51669c..285cf248 100644 --- a/app/server/lib/SamlConfig.ts +++ b/app/server/lib/SamlConfig.ts @@ -260,8 +260,9 @@ export async function getSamlLoginSystem(): Promise }, }; }, - deleteUser() { - throw new Error('users cannot be deleted with SAML yet'); + async deleteUser() { + // If we could delete the user account in the external + // authentication system, this is our chance - but we can't. }, }; }