We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 52269
    • 3 Posts
    I need to completely disable the redirect of Login snippet. As a temporary solution, I have set
    loginResourceId=>empty_page & logoutResourceId=>empty_page but that still creates unnecessary traffic to the empty_page.

    My site has full AJAX Login/Logout pop-ups invoking the Login snippet returning HTTP status code 200 or 302 and redirecting to specified ResourceID (of the empty_page). AJAX also reloads the page upon Login/Logout, so the Login redirect is completely useless.
    Any suggestions how to disable the redirect? I'm starting looking at the login.class.php file but I hope the mod can be done with a parameter so that the redirect doesn't re-activate on a Login snippet update.

    Thanks!

    This question has been answered by cbureriu. See the first response.

    • discuss.answer
      • 52269
      • 3 Posts
      got it
      commenting out line 364 in
      core/components/login/controllers/web/login.php

      //$this->modx->sendRedirect($this->modx->getOption('site_url'));

      and not setting login snippet redirect parameters 'loginResourceId' and 'logoutResourceId'

      before this mod Login snippet redirected either to ResourceID or, if undefined, to site_url

      simpler way:

      public function redirectAfterLogin(modProcessorResponse $response) {
      return; // <-- disabling the entire function [ed. note: cbureriu last edited this post 5 years, 11 months ago.]