Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated OAuth2 provider and organization fields in account creation e-mails #91

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added AI_tests/test.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,32 @@ 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 provider = oAuth2ProviderId;
sendNewOAuthAccountMessage(fullName, email, provider);
String organization = user.getOrganization();
String[] providerFields = oAuth2ProviderId.split(";");
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 provider) {
// beans getting a reference to the sender
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); // bean
jsonObj.put("email", email); // bean
jsonObj.put("provider", provider); // bean
jsonObj.put("fullName", fullName);
jsonObj.put("localUid", localUid);
jsonObj.put("email", email);
jsonObj.put("organization", organization);
jsonObj.put("providerName", providerName);
jsonObj.put("providerUid", providerUid);
eventTemplate.convertAndSend("routing-gateway", jsonObj.toString());// send
}
}
Loading