Good day! I have a question for you: how can I properly redirect the auth.class.php class in its functions? I did it by analogy with standard functions (Login in a class), it uses the following code to redirect:
$this->_sendRedirect('login'); Which in this function is described later as follows:
if ($action == 'login' && $this->config['loginResourceId']) { if (in_array($this->config['loginResourceId'], $error_pages)) { $this->config['loginResourceId'] = $this->config['page_id']; } $url = $this->modx->makeUrl($this->config['loginResourceId'], '', '', 'full'); } elseif ($action == 'logout' && $this->config['logoutResourceId']) { if (in_array($this->config['logoutResourceId'], $error_pages)) { $this->config['logoutResourceId'] = $this->config['page_id']; } $url = $this->modx->makeUrl($this->config['logoutResourceId'], '', '', 'full'); } In my function formRepair, I also try to send a redirect, but the problem is that when I do this before Return returns, the form hangs. If after return, then the redirect simply does not work:
return $this->success("Смс отправлена на ваш телефон!"); $this->_sendRedirect('login'); So how to get your function to work with the redirect? What is the secret here?
Although in the same procedure, the Login redirect comes before the value of the function is returned:
$this->_sendRedirect('login'); return true;