4242 */
4343public class PortalURLResolver extends AbstractFlowExecutionListener {
4444
45- private static final Log log = LogFactory .getLog (PortalURLResolver .class );
45+ private static final Log LOG = LogFactory .getLog (PortalURLResolver .class );
4646 private final BrandingPreferenceManagerImpl brandingPreferenceManager ;
4747 public static final String SELF_SIGN_UP_URL = "selfSignUpURL" ;
4848 public static final String DEFAULT_REGISTRATION_PORTAL_URL = "/authenticationendpoint/register.do" ;
@@ -78,7 +78,6 @@ public boolean doPreExecute(FlowExecutionContext context) {
7878 if (StringUtils .isNotBlank (context .getPortalUrl ())) {
7979 return true ;
8080 }
81-
8281 String applicationId = context .getApplicationId ();
8382 String tenantDomain = context .getTenantDomain ();
8483 String type = StringUtils .isBlank (applicationId ) ? ORGANIZATION_TYPE : APPLICATION_TYPE ;
@@ -96,39 +95,40 @@ public boolean doPreExecute(FlowExecutionContext context) {
9695 if (StringUtils .isNotBlank (signUpUrl )) {
9796 context .setPortalUrl (signUpUrl );
9897 } else {
99- log .debug ("Self sign-up URL not configured for tenant: " + tenantDomain +
100- ". Using default URL." );
98+ logMissingSelfSignupUrl (context );
10199 context .setPortalUrl (buildDefaultRegistrationUrl ());
102100 }
103101 }
104102 }
105103 if (StringUtils .isBlank (context .getPortalUrl ())) {
106- log .debug (String .format ("No branding preference found for type: %s, name: %s, tenant: %s." +
107- " Using default URL." , type , name , tenantDomain ));
104+ logMissingSelfSignupUrl (context );
108105 context .setPortalUrl (buildDefaultRegistrationUrl ());
109106 }
110107 return true ;
111108 } catch (BrandingPreferenceMgtClientException e ) {
112- log .debug ("Self sign-up URL not configured for tenant: " + context .getTenantDomain () +
113- ". Using default URL." );
109+ logMissingSelfSignupUrl (context );
114110 try {
115111 context .setPortalUrl (buildDefaultRegistrationUrl ());
116112 } catch (URLBuilderException ex ) {
117- log .error ("Failed to build default registration URL for tenant: " + context .getTenantDomain (), ex );
113+ LOG .error ("Failed to build default registration URL for tenant: " + context .getTenantDomain (), ex );
118114 return false ;
119115 }
120116 return true ;
121-
122117 } catch (BrandingPreferenceMgtException e ) {
123- log .error ("Error retrieving branding preference for tenant: " + context .getTenantDomain (), e );
118+ LOG .error ("Error retrieving branding preference for tenant: " + context .getTenantDomain (), e );
124119 return false ;
125-
126120 } catch (URLBuilderException e ) {
127- log .error ("Error building default registration portal URL for tenant: " + context .getTenantDomain (), e );
121+ LOG .error ("Error building default registration portal URL for tenant: " + context .getTenantDomain (), e );
128122 return false ;
129123 }
130124 }
131125
126+ private static void logMissingSelfSignupUrl (FlowExecutionContext context ) {
127+
128+ LOG .debug ("Self sign-up URL not configured for tenant: " + context .getTenantDomain () + ". Using default URL: "
129+ + DEFAULT_REGISTRATION_PORTAL_URL );
130+ }
131+
132132 private String buildDefaultRegistrationUrl () throws URLBuilderException {
133133
134134 return ServiceURLBuilder .create ()
0 commit comments