mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix login/logout in jobs
This commit is contained in:
parent
1e9887efb8
commit
16beef182e
@ -55,8 +55,10 @@ class ImportData extends Job implements ShouldQueue
|
|||||||
{
|
{
|
||||||
$includeSettings = false;
|
$includeSettings = false;
|
||||||
|
|
||||||
Auth::onceUsingId($this->user->id);
|
if (App::runningInConsole()) {
|
||||||
$this->user->account->loadLocalizationSettings();
|
Auth::onceUsingId($this->user->id);
|
||||||
|
$this->user->account->loadLocalizationSettings();
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->type === IMPORT_JSON) {
|
if ($this->type === IMPORT_JSON) {
|
||||||
$includeData = $this->settings['include_data'];
|
$includeData = $this->settings['include_data'];
|
||||||
@ -78,6 +80,8 @@ class ImportData extends Job implements ShouldQueue
|
|||||||
$message = $importService->presentResults($results, $includeSettings);
|
$message = $importService->presentResults($results, $includeSettings);
|
||||||
$userMailer->sendMessage($this->user, $subject, $message);
|
$userMailer->sendMessage($this->user, $subject, $message);
|
||||||
|
|
||||||
Auth::logout();
|
if (App::runningInConsole()) {
|
||||||
|
Auth::logout();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class SendInvoiceEmail extends Job implements ShouldQueue
|
|||||||
{
|
{
|
||||||
// send email as user
|
// send email as user
|
||||||
if (App::runningInConsole() && $this->userId) {
|
if (App::runningInConsole() && $this->userId) {
|
||||||
Auth::loginUsingId($this->userId);
|
Auth::onceUsingId($this->userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailer->sendInvoice($this->invoice, $this->reminder, $this->template);
|
$mailer->sendInvoice($this->invoice, $this->reminder, $this->template);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user