Hi, the question isn’t directly related to sst, bu...
# help
a
Hi, the question isn’t directly related to sst, but how can I merge google identity user in cognito with the usual cognito identity with the same email to 1 user?
f
Hey @Artem Kalantai, do you mean merging 2 identities in Identity Pool? Ie. does your identity pool has 2 auth providers, cognito user pool and google, and you want to merge two identities, 1 from each provider?
a
exactly
a
I’ve found this
Copy code
const params = {
    DestinationUser: {
      ProviderAttributeValue: username,
      ProviderName: 'Cognito'
    },
    SourceUser: {
      ProviderAttributeName: 'Cognito_Subject',
      ProviderAttributeValue: providerUserId,
      ProviderName: providerName
    },
    UserPoolId: userPoolId
  }

  return await cognitoIdp.adminLinkProviderForUser(params).promise()
and this works fine
so, about MergeDeveloperIdentities - Only developer-authenticated users can be merged - not what I need
Copy code
adminLinkProviderForUser
this what I needed, but now I have pain in the ass because it works only if the user registered Email/password and then trying social login - works great, but vice versa it doesn’t work