From 33e132cb0075fa93360577e32f0824086aecf8dd Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Tue, 24 Sep 2024 16:20:00 +0700 Subject: [PATCH] UBERF-8251: Fix github re-authenticate (#6704) Signed-off-by: Andrey Sobolev --- services/github/github-resources/src/components/utils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/github/github-resources/src/components/utils.ts b/services/github/github-resources/src/components/utils.ts index 2a49911c2c..5600ca53c7 100644 --- a/services/github/github-resources/src/components/utils.ts +++ b/services/github/github-resources/src/components/utils.ts @@ -24,10 +24,10 @@ export async function onAuthorize (login?: string): Promise { ) const client = getClient() - const config = await client.findOne(github.class.GithubAuthentication, {}) - - if (config !== undefined) { - await client.remove(config) + // Remove old authorizations. + const config = await client.findAll(github.class.GithubAuthentication, {}) + for (const c of config) { + await client.remove(c) } await client.createDoc(github.class.GithubAuthentication, core.space.Workspace, { attachedTo: meId,