Skip to content

Commit

Permalink
new account recovery api: addressing changes
Browse files Browse the repository at this point in the history
  • Loading branch information
somindatommy committed Jan 9, 2020
1 parent f5b109c commit bdf2e2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,13 +254,13 @@ public enum ErrorMessages {
ERROR_CODE_PASSWORD_RECOVERY_WITH_NOTIFICATIONS_NOT_ENABLED(
"PWR-10002", "Password recovery with notifications is not enabled"),
ERROR_CODE_NO_PASSWORD_IN_REQUEST("PWR-10003", "No password found"),
ERROR_CODE_PASSWORD_RECOVERY_NOT_ENABLED("UNR-10004", "Password recovery is not enabled"),
ERROR_CODE_PASSWORD_HISTORY_VIOLATION("UNR-10005", "This password has been used in recent "
ERROR_CODE_PASSWORD_RECOVERY_NOT_ENABLED("PWR-10004", "Password recovery is not enabled"),
ERROR_CODE_PASSWORD_HISTORY_VIOLATION("PWR-10005", "This password has been used in recent "
+ "history. Please choose a different password"),
ERROR_CODE_PASSWORD_POLICY_VIOLATION("UNR-10006", "Password policy violation"),
ERROR_CODE_INVALID_CALLBACK_PASSWORD_RESET("UNR-10007", "Invalid callback url in password " +
ERROR_CODE_PASSWORD_POLICY_VIOLATION("PWR-10006", "Password policy violation"),
ERROR_CODE_INVALID_CALLBACK_PASSWORD_RESET("PWR-10007", "Invalid callback url in password " +
"reset request"),
ERROR_CODE_PASSWORD_RECOVERY_EMPTY_TENANT_DOMAIN("UNR-10008", "Empty tenant domain in password "
ERROR_CODE_PASSWORD_RECOVERY_EMPTY_TENANT_DOMAIN("PWR-10008", "Empty tenant domain in password "
+ "recovery request"),
ERROR_CODE_UNEXPECTED_ERROR_PASSWORD_RESET("PWR-15001", "Unexpected error during "
+ "password reset");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public ResendConfirmationDTO resendConfirmation(String tenantDomain, String rese
UserRecoveryData userRecoveryData = userAccountRecoveryManager
.getUserRecoveryData(resendCode, RecoverySteps.RESEND_CONFIRMATION_CODE);
User user = userRecoveryData.getUser();
if (!StringUtils.equals(tenantDomain,user.getTenantDomain())) {
if (!StringUtils.equals(tenantDomain, user.getTenantDomain())) {
throw Utils.handleClientException(
IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_USER_TENANT_DOMAIN_MISS_MATCH_WITH_CONTEXT,
tenantDomain);
Expand All @@ -151,7 +151,7 @@ public ResendConfirmationDTO resendConfirmation(String tenantDomain, String rese
resendCode);
}
// Validate the tenant domain and the recovery scenario in the request.
validateRequestAttributes(user,scenario,userRecoveryData.getRecoveryScenario(),tenantDomain,resendCode);
validateRequestAttributes(user, scenario, userRecoveryData.getRecoveryScenario(), tenantDomain, resendCode);
validateCallback(properties, user.getTenantDomain());
UserRecoveryDataStore userRecoveryDataStore = JDBCRecoveryDataStore.getInstance();
userRecoveryDataStore.invalidate(user);
Expand Down Expand Up @@ -195,7 +195,7 @@ private void validateRequestAttributes(User recoveredUser, RecoveryScenarios sce
String tenantDomainInRequest, String resendCode)
throws IdentityRecoveryClientException {

if (!StringUtils.equals(tenantDomainInRequest,recoveredUser.getTenantDomain())) {
if (!StringUtils.equals(tenantDomainInRequest, recoveredUser.getTenantDomain())) {
throw Utils.handleClientException(
IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_USER_TENANT_DOMAIN_MISS_MATCH_WITH_CONTEXT,
tenantDomainInRequest);
Expand Down

0 comments on commit bdf2e2c

Please sign in to comment.