private boolean isValidRecoveryUrl ( StringBuilder recoveryUrl ) { String pageSuffix = adminConfig . getPageSufix ( ) ; return ! recoveryUrl . toString ( ) . contains ( Constants . DEFAULT_INDEX_PAGE . replace ( "xhtml" , pageSuffix ) ) && ! recoveryUrl . toString ( ) . contains ( Constants . DEFAULT_ACCESS_DENIED_PAGE . replace ( "xhtml" , adminConfig . getPageSufix ( ) ) ) && ! recoveryUrl . toString ( ) . contains ( Constants . DEFAULT_EXPIRED_PAGE . replace ( "xhtml" , pageSuffix ) ) && ! recoveryUrl . toString ( ) . contains ( Constants . DEFAULT_OPTIMISTIC_PAGE . replace ( "xhtml" , adminConfig . getPageSufix ( ) ) ) && ! recoveryUrl . toString ( ) . contains ( Constants . DEFAULT_LOGIN_PAGE . replace ( "xhtml" , adminConfig . getPageSufix ( ) ) ) ; }
Skip error pages login and index page as recovery url because it doesn t make sense redirecting user to such pages