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) {