Skip to content

Commit

Permalink
Send OTP in email in Ask-password flow based on the configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
shanggeeth committed Oct 20, 2023
1 parent ccfa6d8 commit 8c8c3d4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,14 @@ public void handleEvent(Event event) throws IdentityEventException {
Utils.publishRecoveryEvent(eventProperties, IdentityEventConstants.Event.POST_VERIFY_EMAIL_CLAIM,
confirmationCode);
} else if (IdentityRecoveryConstants.ASK_PASSWORD_CLAIM.equals(claim.getClaimUri())) {
String confirmationCode = UUID.randomUUID().toString();
String confirmationCode;
try {
confirmationCode = Utils.generateSecretKey(
NotificationChannels.EMAIL_CHANNEL.getChannelType(), RecoveryScenarios.ASK_PASSWORD.name(),
user.getTenantDomain(), "EmailVerification");
} catch (IdentityRecoveryServerException e) {
throw new IdentityEventException("Error while fetching the OTP pattern ", e);
}
if (isAccountClaimExist) {
setUserClaim(IdentityRecoveryConstants.ACCOUNT_STATE_CLAIM_URI,
IdentityRecoveryConstants.PENDING_ASK_PASSWORD, userStoreManager, user);
Expand Down

0 comments on commit 8c8c3d4

Please sign in to comment.