From df9ade4ff47b2e75150a56fafceea8ad0422e92e Mon Sep 17 00:00:00 2001 From: denisdulici Date: Tue, 6 Mar 2018 17:49:27 +0300 Subject: [PATCH] fixed #220 --- app/Http/Controllers/Auth/Login.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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('/');