From 7ef128413c20e93b2a2f14d64fc2ae8505df0155 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 14 Dec 2017 16:36:05 +0200 Subject: [PATCH] Fix for client portal permalink login --- app/Http/Controllers/ClientAuth/LoginController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ClientAuth/LoginController.php b/app/Http/Controllers/ClientAuth/LoginController.php index a6a779b43936..c2fee0afb1df 100644 --- a/app/Http/Controllers/ClientAuth/LoginController.php +++ b/app/Http/Controllers/ClientAuth/LoginController.php @@ -91,8 +91,10 @@ class LoginController extends Controller $credentials = $request->only('email', 'password'); $account = false; - // resovle the email to a contact/account - if ($accountKey = request()->account_key) { + // resolve the email to a contact/account + if (! Utils::isNinja() && Account::count() == 1) { + $account = Account::first(); + } elseif ($accountKey = request()->account_key) { $account = Account::whereAccountKey($accountKey)->first(); } else { $subdomain = Utils::getSubdomain(\Request::server('HTTP_HOST'));