mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-08 18:57:42 +02:00
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:
@@ -341,7 +341,7 @@ export class GithubWorker implements IntegrationManager {
|
||||
// Find a local social id already existing
|
||||
const existingSocialId = await this._client.findOne(contact.class.SocialIdentity, {
|
||||
type: SocialIdType.GITHUB,
|
||||
value: userInfo.login
|
||||
value: userInfo.login.toLowerCase()
|
||||
})
|
||||
|
||||
if (existingSocialId !== undefined) {
|
||||
@@ -350,7 +350,7 @@ export class GithubWorker implements IntegrationManager {
|
||||
|
||||
const { uuid, socialId } = await this.accountClient.ensurePerson(
|
||||
SocialIdType.GITHUB,
|
||||
userInfo.login,
|
||||
userInfo.login.toLowerCase(),
|
||||
userInfo.name ?? userInfo.login,
|
||||
''
|
||||
)
|
||||
@@ -366,10 +366,10 @@ export class GithubWorker implements IntegrationManager {
|
||||
'socialIds',
|
||||
{
|
||||
type: SocialIdType.GITHUB,
|
||||
value: userInfo.login,
|
||||
value: userInfo.login.toLowerCase(),
|
||||
key: buildSocialIdString({
|
||||
type: SocialIdType.GITHUB,
|
||||
value: userInfo.login
|
||||
value: userInfo.login.toLowerCase()
|
||||
}),
|
||||
verifiedOn: Date.now()
|
||||
},
|
||||
@@ -471,7 +471,7 @@ export class GithubWorker implements IntegrationManager {
|
||||
if (userInfo.email != null && userInfo.email.trim().length > 0) {
|
||||
const personAccount = await this.client.findOne(contact.class.SocialIdentity, {
|
||||
type: SocialIdType.EMAIL,
|
||||
value: userInfo.email
|
||||
value: userInfo.email.toLowerCase()
|
||||
})
|
||||
person = personAccount?.attachedTo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user