UBERF-9724: Fix github functionality on 0.7 (#8554)

* UBERF-9724: Fix github functionality on 0.7

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>

* Fix exception for no social id for system account

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>

---------

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2025-04-15 17:18:49 +07:00
committed by GitHub
parent a8d6eaca92
commit e20ec51363
6 changed files with 69 additions and 35 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
import type { AccountClient, IntegrationSecret } from '@hcengineering/account-client'
import { systemAccountUuid, type PersonId, type WorkspaceUuid } from '@hcengineering/core'
import core, { systemAccountUuid, type PersonId, type WorkspaceUuid } from '@hcengineering/core'
import { getAccountClient } from '@hcengineering/server-client'
import { generateToken } from '@hcengineering/server-token'
import type { GithubUserRecord } from './types'
@@ -49,6 +49,9 @@ export class UserManager {
if (rec !== undefined) {
return rec
}
if (ref === core.account.System || ref === core.account.ConfigUser) {
return undefined
}
const secrets = await this.accountClient.listIntegrationsSecrets({ kind: 'github-user', socialId: ref })
if (secrets.length === 0) {