Skip to content

Commit

Permalink
Some changes for better consistency of templates and OOB checking
Browse files Browse the repository at this point in the history
  • Loading branch information
emmdurin committed Jan 11, 2024
1 parent fe3924f commit a775118
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,28 @@ public void on(AccountCreated event) {
final String oAuth2ProviderId = user.getOAuth2ProviderId();
if (null != oAuth2ProviderId) {
String fullName = user.getFirstName() + " " + user.getLastName();
String localUid = user.getUsername();
String email = user.getEmail();
String organization = user.getOrganization();
String[] providerFields = oAuth2ProviderId.split(";");
sendNewOAuthAccountMessage(fullName, email, organization, providerFields[0], providerFields[1]);
String providerName = "";
String providerUid = "";
if(providerFields.length == 2)
{
providerName = providerFields[0];
providerUid = providerFields[1];
}
sendNewOAuthAccountMessage(fullName, localUid, email, organization, providerName, providerUid);
}
}

public void sendNewOAuthAccountMessage(String fullName, String email, String organization, String providerName,
String providerUid) {
public void sendNewOAuthAccountMessage(String fullName, String localUid, String email, String organization,
String providerName, String providerUid) {
JSONObject jsonObj = new JSONObject();
jsonObj.put("uid", UUID.randomUUID());
jsonObj.put("subject", OAUTH2_ACCOUNT_CREATION);
jsonObj.put("username", fullName);
jsonObj.put("fullName", fullName);
jsonObj.put("localUid", localUid);
jsonObj.put("email", email);
jsonObj.put("organization", organization);
jsonObj.put("providerName", providerName);
Expand Down

0 comments on commit a775118

Please sign in to comment.