|
@@ -83,6 +83,7 @@ import java.util.LinkedHashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Locale;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.Optional;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
|
|
|
|
public class ForgottenPasswordUtil
|
|
public class ForgottenPasswordUtil
|
|
@@ -630,12 +631,17 @@ public class ForgottenPasswordUtil
|
|
)
|
|
)
|
|
throws PwmUnrecoverableException
|
|
throws PwmUnrecoverableException
|
|
{
|
|
{
|
|
- ProfileUtility.discoverProfileIDForUser(
|
|
|
|
|
|
+ final Optional<String> profileID = ProfileUtility.discoverProfileIDForUser(
|
|
pwmApplication,
|
|
pwmApplication,
|
|
sessionLabel,
|
|
sessionLabel,
|
|
userIdentity,
|
|
userIdentity,
|
|
ProfileDefinition.ForgottenPassword
|
|
ProfileDefinition.ForgottenPassword
|
|
- ).ifPresent( ( id ) -> pwmApplication.getConfig().getForgottenPasswordProfiles().get( id ) );
|
|
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ if ( profileID.isPresent() )
|
|
|
|
+ {
|
|
|
|
+ return pwmApplication.getConfig().getForgottenPasswordProfiles().get( profileID.get() );
|
|
|
|
+ }
|
|
|
|
|
|
final String msg = "user does not have a forgotten password profile assigned";
|
|
final String msg = "user does not have a forgotten password profile assigned";
|
|
throw PwmUnrecoverableException.newException( PwmError.ERROR_NO_PROFILE_ASSIGNED, msg );
|
|
throw PwmUnrecoverableException.newException( PwmError.ERROR_NO_PROFILE_ASSIGNED, msg );
|