We have a link which has some UTM code at the end like this:
This link is a gated page, so of course, the user is 302 redirected to https://website.com/login, but the query string is not kept.
I tried modifying the redirectTo method in the Authenticate middleware from
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
to
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login', $request->query());
}
}
but to no avail. Which is weird, because echoing route('login', $request->query())
shows the correct URL.
Any ideas are appreciated!