Skip to content

Commit

Permalink
Removed invitation token from the invite email (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
pc9795 committed Oct 14, 2020
1 parent cbb098e commit 8a892b6
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class UserServiceImpl extends BaseService<UserRepository, User, String> i
private static final String WELCOME_USER_EMAIL_TEMPLATE = "email/welcomeUserTemplate.html";
private static final String FORGOT_PASSWORD_EMAIL_TEMPLATE = "email/forgotPasswordTemplate.html";
private static final String FORGOT_PASSWORD_CLIENT_URL_FORMAT = "%s/user/resetPassword?token=%s&email=%s";
private static final String INVITE_USER_CLIENT_URL_FORMAT = "%s/user/signup?token=%s&email=%s";
private static final String INVITE_USER_CLIENT_URL_FORMAT = "%s/user/signup?email=%s";
private static final String INVITE_USER_EMAIL_TEMPLATE = "email/inviteUserCreatorTemplate.html";
private static final String USER_ADDED_TO_ORGANIZATION_EMAIL_TEMPLATE = "email/inviteExistingUserToOrganizationTemplate.html";
// We default the origin header to the production deployment of the client's URL
Expand Down Expand Up @@ -691,15 +691,13 @@ private Mono<User> createNewUserAndSendInviteEmail(String email, String originHe
// Call user service's userCreate function so that the personal organization, etc are also created along with assigning basic permissions.
return userCreate(newUser)
.flatMap(createdUser -> {
log.debug("Going to send email for invite user to {} with token {}", createdUser.getEmail(), createdUser.getInviteToken());
log.debug("Going to send email for invite user to {}", createdUser.getEmail());
String inviteUrl = String.format(
INVITE_USER_CLIENT_URL_FORMAT,
originHeader,
URLEncoder.encode(createdUser.getInviteToken(), StandardCharsets.UTF_8),
URLEncoder.encode(createdUser.getEmail(), StandardCharsets.UTF_8)
);

params.put("token", createdUser.getInviteToken());
params.put("inviteUrl", inviteUrl);
Mono<String> emailMono = emailSender.sendMail(createdUser.getEmail(), "Invite for Appsmith", INVITE_USER_EMAIL_TEMPLATE, params);

Expand Down

0 comments on commit 8a892b6

Please sign in to comment.