Summer Sale! All accounts are 50% off this week.

untymage's avatar

Disable redirecting to /home route after login for SPA

I'm building a SPA app with laravel and vue, How to disable redirecting after successfully login ? I mainpulated $redirectTo = falsein LoginController but not working.

0 likes
2 replies
alanholmes's avatar

Hi @untymage

How are you doing the login? if you are using a ajax (json) request, it will return a json response rather than a redirect

        return $request->wantsJson()
                    ? new Response('', 204)
                    : redirect()->intended($this->redirectPath());
1 like
untymage's avatar

Yeah my bad, I clicked two time on login button the first response was ok the second one have redirected response

Please or to participate in this conversation.