You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior, and steps to reproduce if appropriate
I think (as describe the function doc): return redirect(base_url('/login'))->with('tplError', 'Invalid username or password'); return redirect('/login')->with('tplError', 'Invalid username or password');
Must have the same behavior as: return redirect('login')->with('tplError', 'Invalid username or password'); (this works)
When using redirect('foo') it treats that as a reverse-routed request, which is why 'login' works but base_url('login') doesn't. That is in the docs, and is there as a security helper.
If you need to specify a full url, use redirect()->to('foo') instead.
Describe the bug
This redirects fails in my controller when upgrading from V4.0.0-alpha2 to V4.0.0-alpha3 (or develop branch):
return redirect(base_url('/login'))->with('tplError', 'Invalid username or password');
return redirect('/login')->with('tplError', 'Invalid username or password');
return redirect(base_url('/dashboard/1'))->with('notifSuccess', 'Login OK');
The value of
base_url('/login')
ishttps://dev.dasua.es/login
and this works when I write in the browser (is a valid url).The value of
base_url('/dashboard/1')
ishttps://dev.dasua.es/dashboard/1
and this works when I write in the browser (is a valid url).Throws CodeIgniter\HTTP\Exceptions\HTTPException BASEPATH/HTTP/Exceptions/HTTPException.php at line 106
At CodeIgniter\Router\RouteCollection::reverseRoute method, I get this values:
A partital content of
$this->routes
is:The value of
$search
method parameter ishttps://dev.dasua.es/login
.The value of
...$params
is an empty array.CodeIgniter 4 version
v4.0.0-alpha.3 or develop branch
Affected module(s)
CodeIgniter\Router\RouteCollection::reverseRoute()
Expected behavior, and steps to reproduce if appropriate
I think (as describe the function doc):
return redirect(base_url('/login'))->with('tplError', 'Invalid username or password');
return redirect('/login')->with('tplError', 'Invalid username or password');
Must have the same behavior as:
return redirect('login')->with('tplError', 'Invalid username or password');
(this works)And:
return redirect(base_url('/dashboard/1'))->with('notifSuccess', 'Login OK');
return redirect('/dashboard/1')->with('notifSuccess', 'Login OK');
return redirect('dashboard/1')->with('notifSuccess', 'Login OK');
Must have the same behavior as:
Context
The text was updated successfully, but these errors were encountered: