From e2d7cf3c488ea7e1c1bc9ffc3bde606128a928b8 Mon Sep 17 00:00:00 2001 From: mohitdeuex Date: Thu, 30 Nov 2023 12:50:13 +0530 Subject: [PATCH] Fix User Startup Email --- .../java/org/openmetadata/service/util/UserUtil.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/util/UserUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/util/UserUtil.java index b0d315798384..5cad3d686fd0 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/util/UserUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/util/UserUtil.java @@ -76,8 +76,9 @@ private static void createOrUpdateUser(AuthProvider authProvider, String usernam if (authProvider.equals(AuthProvider.BASIC)) { if (originalUser.getAuthenticationMechanism() == null || originalUser.getAuthenticationMechanism().equals(new AuthenticationMechanism())) { - updateUserWithHashedPwd(updatedUser, getPassword()); - EmailUtil.sendInviteMailToAdmin(updatedUser, ADMIN_USER_NAME); + String randomPwd = getPassword(); + updateUserWithHashedPwd(updatedUser, randomPwd); + EmailUtil.sendInviteMailToAdmin(updatedUser, randomPwd); } } else { updatedUser.setAuthenticationMechanism(new AuthenticationMechanism()); @@ -100,8 +101,9 @@ private static void createOrUpdateUser(AuthProvider authProvider, String usernam updatedUser = user(username, domain, username).withIsAdmin(isAdmin).withIsEmailVerified(true); // Update Auth Mechanism if not present, and send mail to the user if (authProvider.equals(AuthProvider.BASIC)) { - updateUserWithHashedPwd(updatedUser, getPassword()); - EmailUtil.sendInviteMailToAdmin(updatedUser, ADMIN_USER_NAME); + String randomPwd = getPassword(); + updateUserWithHashedPwd(updatedUser, randomPwd); + EmailUtil.sendInviteMailToAdmin(updatedUser, randomPwd); } }