diff --git a/app/Http/Controllers/Auth/Login.php b/app/Http/Controllers/Auth/Login.php index 6ff67d6b7..64ce30436 100644 --- a/app/Http/Controllers/Auth/Login.php +++ b/app/Http/Controllers/Auth/Login.php @@ -70,7 +70,14 @@ class Login extends Controller // Check if is customer if ($user->customer) { - return redirect()->intended('customers'); + $path = session('url.intended', 'customers'); + + // Path must start with 'customers' prefix + if ($path == env('APP_URL')) { + $path = 'customers'; + } + + return redirect($path); } return redirect('/');