[Resolved] Cake 3.4 redirecting users after login


3.4 dropped Auth.redirect session value. Now AuthComponent::redirectUrl() will return redirect query string value if it is present.

That means when a user calls a link what is behind authentication he will be redirected to the login page. There I should add manually the redirect query string to the login form action property, as it is not added automatically. And if the original link conatined query string I should add it back again?

I do not really see the advantage of this approach, prior to 3.4 all this happened automatically.

verify they are logged and I just

return $this->redirect('/dog/indexadmin');

Finally waht seemed to be the easiest way is to have this in my login.ctp

                'url' => [
                    'controller' => 'Users',
                    'action' => 'login',
                    'redirect' => $this->request->getQuery('redirect')