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

Fixes for company tokens (#3612)

This commit is contained in:
David Bomba 2020-04-09 22:36:20 +10:00 committed by GitHub
parent 4b18041d36
commit 36c2c64625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 29 deletions

View File

@ -55,7 +55,7 @@ class ArtisanUpgrade extends Command
}
putenv('COMPOSER_HOME=' . __DIR__ . '/vendor/bin/composer');
$input = new ArrayInput(array('command' => 'install'));
$input = new ArrayInput(array('command' => 'update'));
$application = new Application();
$application->setAutoExit(true); // prevent `$application->run` method from exitting the script
$application->run($input);

View File

@ -31,6 +31,7 @@ use Faker\Factory;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
class CreateTestData extends Command
{
@ -101,16 +102,14 @@ class CreateTestData extends Command
'confirmation_code' => $this->createDbHash(config('database.default'))
]);
}
$token = \Illuminate\Support\Str::random(64);
$company_token = CompanyToken::create([
'user_id' => $user->id,
'company_id' => $company->id,
'account_id' => $account->id,
'name' => 'test token',
'token' => $token,
]);
$company_token = new CompanyToken;
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
$company_token->name = 'test token';
$company_token->token = Str::random(64);
$company_token->save();
$user->companies()->attach($company->id, [
'account_id' => $account->id,
@ -183,15 +182,13 @@ class CreateTestData extends Command
]);
}
$token = \Illuminate\Support\Str::random(64);
$company_token = CompanyToken::create([
'user_id' => $user->id,
'company_id' => $company->id,
'account_id' => $account->id,
'name' => 'test token',
'token' => $token,
]);
$company_token = new CompanyToken;
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
$company_token->name = 'test token';
$company_token->token = Str::random(64);
$company_token->save();
$user->companies()->attach($company->id, [
'account_id' => $account->id,
@ -289,15 +286,13 @@ class CreateTestData extends Command
]);
}
$token = \Illuminate\Support\Str::random(64);
$company_token = CompanyToken::create([
'user_id' => $user->id,
'company_id' => $company->id,
'account_id' => $account->id,
'name' => 'test token',
'token' => $token,
]);
$company_token = new CompanyToken;
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
$company_token->name = 'test token';
$company_token->token = Str::random(64);
$company_token->save();
$user->companies()->attach($company->id, [
'account_id' => $account->id,