From 0575beb3cc72e7a64bc7d58565838a700e9099fd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 4 May 2025 16:23:47 +1000 Subject: [PATCH] Fixes for login auth --- app/Http/Controllers/Auth/LoginController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index 1c90f33e20..90cf60d3eb 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -208,7 +208,7 @@ class LoginController extends BaseController $cu->where('company_id', $company_token->company_id); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !$cu->first()->user->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !$cu->first()->user->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); } @@ -289,7 +289,7 @@ class LoginController extends BaseController return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !$existing_user->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !$existing_user->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); } @@ -318,7 +318,7 @@ class LoginController extends BaseController return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !$existing_login_user->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !$existing_login_user->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); } @@ -367,7 +367,7 @@ class LoginController extends BaseController return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !auth()->user()->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !auth()->user()->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); } @@ -501,7 +501,7 @@ class LoginController extends BaseController return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !$existing_user->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !$existing_user->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); } @@ -526,7 +526,7 @@ class LoginController extends BaseController return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !auth()->user()->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !auth()->user()->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); } @@ -634,7 +634,7 @@ class LoginController extends BaseController return response()->json(['message' => 'User found, but not attached to any companies, please see your administrator'], 400); } - if (Ninja::isHosted() && !$cu->first()->is_owner && !auth()->user()->account->isEnterpriseClient()) { + if (Ninja::isHosted() && !$cu->first()->is_owner && !auth()->user()->account->isEnterprisePaidClient()) { return response()->json(['message' => 'Pro / Free accounts only the owner can log in. Please upgrade'], 403); }