From 24cfda9b18f3b66a8e8729790cf528c91114763e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 29 Aug 2022 17:07:20 +1000 Subject: [PATCH] Add checks for oauth provider id --- app/Console/Commands/CheckData.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index e993454c2d..26df1762a6 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -29,6 +29,7 @@ use App\Models\Payment; use App\Models\Paymentable; use App\Models\QuoteInvitation; use App\Models\RecurringInvoiceInvitation; +use App\Models\User; use App\Models\Vendor; use App\Utils\Ninja; use Exception; @@ -115,7 +116,8 @@ class CheckData extends Command $this->checkCompanyData(); $this->checkBalanceVsPaidStatus(); $this->checkDuplicateRecurringInvoices(); - + $this->checkOauthSanity(); + if(Ninja::isHosted()) $this->checkAccountStatuses(); @@ -146,6 +148,15 @@ class CheckData extends Command $this->log .= $str."\n"; } + private function checkOauthSanity() + { + User::where('oauth_provider_id', '1')->cursor()->each(function ($user){ + + $this->logMessage("Invalid provider ID for user id# {$user->id}"); + + }); + } + private function checkDuplicateRecurringInvoices() {