We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dace47b commit 57b3295Copy full SHA for 57b3295
src/Config/Auth.php
@@ -374,8 +374,21 @@ public function registerRedirect(): string
374
375
protected function getUrl(string $url): string
376
{
377
- return strpos($url, 'http') === 0
378
- ? $url
379
- : rtrim(site_url($url), '/ ');
+ // To accommodate all url patterns
+ $final_url = "";
+ switch ($url) {
380
+ case strpos($url, 'http') === 0: // URL begins with 'http'. E.g. http://example.com
381
+ $final_url = $url;
382
+ break;
383
+
384
+ case route_to($url) != null: // URL is a named-route
385
+ $final_url = route_to($url);
386
387
388
+ default: // URL is a route (URI path)
389
+ $final_url = rtrim(site_url($url), '/ ');
390
391
+ }
392
+ return $final_url;
393
}
394
0 commit comments