File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ const authSetup = function () {
4242 const IframeLogoutRequestType = "LOGOUT_REQUEST" ;
4343 const enterpriseCustomers = [ 'zurich' , 'cs' ] ;
4444 const mode = qs [ 'mode' ] || 'signIn' ;
45- let returnAppUrl = qs [ 'retUrl' ] ;
45+ let returnAppUrl = handleSpecificReturnUrl ( qs [ 'retUrl' ] , 'retUrl' ) ;
4646 let appUrl = qs [ 'appUrl' ] || false ;
4747
4848 if ( utmSource &&
@@ -622,6 +622,40 @@ const authSetup = function () {
622622 document . cookie = cname + "=" + cvalue + cdomain + expires + ";path=/" ;
623623 }
624624
625+ function handleSpecificReturnUrl ( value , param ) {
626+ try {
627+ const domain = getHostDomain ( ) ;
628+ const prefixArray = [ 'apps' , 'software' ] ;
629+ if ( domain ) {
630+ for ( let i = 0 ; i < prefixArray . length ; i ++ ) {
631+ if ( value . indexOf ( prefixArray [ i ] + domain ) > - 1 ) {
632+ const queryParam = window . location . search . substr ( 1 ) ;
633+ if ( queryParam ) {
634+ const indx = queryParam . indexOf ( param ) ;
635+ if ( indx > - 1 ) {
636+ //assuming queryParam value like retUrl=xxxxxx
637+ const result = queryParam . substring ( indx + param . length + 1 ) ;
638+ // verify broken url : https://abc.com/&utm=abc
639+ if ( result . indexOf ( '&' ) > - 1 && result . indexOf ( '?' ) === - 1 ) {
640+ return value ;
641+ }
642+ return result ;
643+ } else {
644+ return value ;
645+ }
646+ } else {
647+ return value ;
648+ }
649+ }
650+ }
651+ return value ;
652+ }
653+ return value ;
654+ } catch ( e ) {
655+ logger ( 'Issue while handling specific query param function' , e . message ) ;
656+ return value ;
657+ }
658+ } ;
625659
626660 // execute
627661 init ( ) ;
You can’t perform that action at this time.
0 commit comments