From c2407cb219e722f8c79a324d2fc25adaaa2bf05c Mon Sep 17 00:00:00 2001 From: Joey Marshment-Howell Date: Sun, 3 Mar 2024 19:54:21 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9F=20=F0=9F=90=9B=20=20Fix=20email=20?= =?UTF-8?q?invite=20dual=20write=20to=20keycloak=20(#11481)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../packages/cloud/services/auth/CloudAuthService.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/airbyte-webapp/src/packages/cloud/services/auth/CloudAuthService.tsx b/airbyte-webapp/src/packages/cloud/services/auth/CloudAuthService.tsx index 97e1f4fabc1..a87a77984fb 100644 --- a/airbyte-webapp/src/packages/cloud/services/auth/CloudAuthService.tsx +++ b/airbyte-webapp/src/packages/cloud/services/auth/CloudAuthService.tsx @@ -359,9 +359,13 @@ export const CloudAuthService: React.FC = ({ children }) => { try { ({ user: firebaseUser } = await signInWithEmailLink(firebaseAuth, email)); - await updatePassword(firebaseUser, password); - // Store the password in a ref so that we can use it to create a keycloak user after the firebase user is created - passwordRef.current = password; + await updatePassword(firebaseUser, password).then(() => { + createKeycloakUser({ + authUserId: firebaseUser.uid, + getAccessToken: () => firebaseUser.getIdToken(), + password, + }); + }); } catch (e) { await firebaseAuth.signOut(); if (e.message === EmailLinkErrorCodes.LINK_EXPIRED) {