From 4c034541632542f7130e2f49a5036fa9b03aa6e5 Mon Sep 17 00:00:00 2001 From: Gero Posmyk-Leinemann Date: Tue, 14 Nov 2023 16:52:46 +0000 Subject: [PATCH] fix AuthProviderService.createAuthProvider --- .../server/src/api/auth-provider-service-api.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/components/server/src/api/auth-provider-service-api.ts b/components/server/src/api/auth-provider-service-api.ts index 63f673ee65aec8..73c002f3e1b305 100644 --- a/components/server/src/api/auth-provider-service-api.ts +++ b/components/server/src/api/auth-provider-service-api.ts @@ -42,14 +42,13 @@ export class AuthProviderServiceAPI implements ServiceImpl { - const ownerId = request.owner.case === "ownerId" ? request.owner.value : ""; const organizationId = request.owner.case === "organizationId" ? request.owner.value : ""; - if (!uuidValidate(organizationId) && !uuidValidate(ownerId)) { - throw new ConnectError("organizationId or ownerId is required", Code.InvalidArgument); - } - if (organizationId) { + if (!uuidValidate(organizationId)) { + throw new ConnectError("organizationId is required", Code.InvalidArgument); + } + const result = await this.authProviderService.createOrgAuthProvider(ctxUserId(), { organizationId, host: request.host, @@ -87,10 +86,7 @@ export class AuthProviderServiceAPI implements ServiceImpl { + async listAuthProviders(request: ListAuthProvidersRequest, _: HandlerContext): Promise { const target = request.id; const ownerId = target.case === "userId" ? target.value : ""; const organizationId = target.case === "organizationId" ? target.value : "";