On the page there is a call to the social services component, the user is registered only through them http://joxi.ru/a2X45M1SyW1yv2

called like this

<?$APPLICATION->IncludeComponent( "rosacamp:system.auth.form", "", Array( "COMPONENT_TEMPLATE" => ".default", "FORGOT_PASSWORD_URL" => "", "PROFILE_URL" => "", "REGISTER_URL" => "", "SHOW_ERRORS" => "N" ) 

);?>

after that, the popup opens, in which the user passes authorization through the social network.

in the init.php file I add an event handler

 AddEventHandler("main", "OnAfterUserAuthorize", Array("AfterRegClass", "OnAfterUserAuthorizeHandler")); 

in which I redirect

 Class AfterRegClass{ function OnAfterUserAuthorizeHandler($arFields){ header("Location:/registration/endreg.php"); } 

}

but the redirect occurs in this popap. I also need a popup to close and redirect

  • And what is this component so interesting you use? This is clearly not an embedded solution. After logging in, if you do nothing, the window closes itself? - Andrewus

1 answer 1

 header("Location:/registration/endreg.php"); 

change to

 LocalRedirect("/registration/endreg.php") 

LocalRedirect Method Documentation

You also need to check if the event is triggered, usually done with the help of logging, you can make a log like this AddMessage2Log

  • Judging by the text of the question, this will not solve the problem, although it will save you from potential problems with support. The window is still not closed. - Andrewus