From 11e2e18aa397ec254f789df7abf2a9d6a8913dce Mon Sep 17 00:00:00 2001 From: Mir Arif Hasan Date: Tue, 28 Nov 2023 20:26:59 +0600 Subject: [PATCH] fix: all sso disabling is handled --- .../src/infra-config/infra-config.service.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts b/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts index d9de6b158..f32b20465 100644 --- a/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts +++ b/packages/hoppscotch-backend/src/infra-config/infra-config.service.ts @@ -8,6 +8,7 @@ import { InfraConfigEnumForClient, } from 'src/types/InfraConfig'; import { + AUTH_PROVIDER_NOT_SPECIFIED, DATABASE_TABLE_NOT_EXIST, INFRA_CONFIG_INVALID_INPUT, INFRA_CONFIG_NOT_FOUND, @@ -209,6 +210,9 @@ export class InfraConfigService implements OnModuleInit { newEnabledAuthProviders = enabledAuthProviders.filter( (p) => p !== provider, ); + if (newEnabledAuthProviders.length === 0) { + return E.left(AUTH_PROVIDER_NOT_SPECIFIED); + } } const isUpdated = await this.update(