Skip to content

Instantly share code, notes, and snippets.

View johnny68's full-sized avatar
🏠
Working from home

Altair johnny68

🏠
Working from home
View GitHub Profile
@johnny68
johnny68 / pre-signup.ts
Created February 9, 2022 06:54 — forked from onhate/pre-signup.ts
Merge AWS Cognito External Provider User with Cognito User on Pre SignUp
import { PreSignUpTriggerEvent, PreSignUpTriggerHandler } from 'aws-lambda';
import { CognitoIdentityServiceProvider } from 'aws-sdk';
const providerName = {
google: 'Google',
facebook: 'Facebook'
};
const tryMergeUserAccounts = async (event: PreSignUpTriggerEvent) => {
const { userPoolId, userName } = event;