Moving accounting commands into an Intuit/ namespace, updates to intuit module
This commit is contained in:
@@ -16,9 +16,8 @@ class ProviderTokenRefresh extends Command
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'provider:token:refresh'
|
||||
.' {siteid : Site ID}'
|
||||
.' {provider : Supplier Name}'
|
||||
.' {user : User Email}';
|
||||
.' {user? : User Email}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@@ -34,15 +33,14 @@ class ProviderTokenRefresh extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$site = Site::findOrFail($this->argument('siteid'));
|
||||
Config::set('site',$site);
|
||||
$uo = User::where('email',$this->argument('user') ?: config('osb.admin'))->singleOrFail();
|
||||
|
||||
$so = ProviderOauth::where('name',$this->argument('provider'))->singleOrFail();
|
||||
$uo = User::where('email',$this->argument('user'))->singleOrFail();
|
||||
|
||||
if (($x=$so->tokens->where('user_id',$uo->id))->count() !== 1)
|
||||
abort(500,sprintf('Unknown Tokens for [%s]',$uo->email));
|
||||
|
||||
Job::dispatchSync($x->pop());
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user