Search code examples
phpajaxcakephp-3.0cakephp-3.1

How to login user without redirecting cakephp 3?


I have an application where the user is added using ajax. I want to log them in, but not redirect them so that the other form(s) can be submitted. Is this possible? I have searched the documentation, but couldn't see anything to make it not redirect. I saw you can change the redirect, but how do you not make it redirect at all? I keep getting an err_too_many_redirects, even when I try to redirect to the current page.


Solution

  • Config Auth component as bellow:

    $this->loadComponent('Auth', [
            'loginRedirect' => false
        ]);