1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Add checks for oauth provider id

This commit is contained in:
David Bomba 2022-08-29 17:07:20 +10:00
parent f557a93533
commit 24cfda9b18

View File

@ -29,6 +29,7 @@ use App\Models\Payment;
use App\Models\Paymentable; use App\Models\Paymentable;
use App\Models\QuoteInvitation; use App\Models\QuoteInvitation;
use App\Models\RecurringInvoiceInvitation; use App\Models\RecurringInvoiceInvitation;
use App\Models\User;
use App\Models\Vendor; use App\Models\Vendor;
use App\Utils\Ninja; use App\Utils\Ninja;
use Exception; use Exception;
@ -115,7 +116,8 @@ class CheckData extends Command
$this->checkCompanyData(); $this->checkCompanyData();
$this->checkBalanceVsPaidStatus(); $this->checkBalanceVsPaidStatus();
$this->checkDuplicateRecurringInvoices(); $this->checkDuplicateRecurringInvoices();
$this->checkOauthSanity();
if(Ninja::isHosted()) if(Ninja::isHosted())
$this->checkAccountStatuses(); $this->checkAccountStatuses();
@ -146,6 +148,15 @@ class CheckData extends Command
$this->log .= $str."\n"; $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() private function checkDuplicateRecurringInvoices()
{ {