Skip to content

Commit

Permalink
Create new session on updateCustomer call
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre RAMBAUD committed Jun 25, 2020
1 parent 1707522 commit 31b896d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions classes/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,8 @@ public function updateCustomer(Customer $customer)
$this->cookie->id_cart = (int) $this->cart->id;
$this->cookie->write();
$this->cart->autosetProductAddress();

$this->cookie->registerSession(new CustomerSession());
}

/**
Expand Down
1 change: 0 additions & 1 deletion classes/form/CustomerLoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public function submit()
$this->errors[''][] = $this->translator->trans('Authentication failed.', [], 'Shop.Notifications.Error');
} else {
$this->context->updateCustomer($customer);
$this->context->cookie->registerSession(new CustomerSession());

Hook::exec('actionAuthentication', ['customer' => $this->context->customer]);

Expand Down
4 changes: 2 additions & 2 deletions classes/form/CustomerPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public function save(Customer $customer, $clearTextPassword, $newPassword = '',
{
if ($customer->id) {
return $this->update($customer, $clearTextPassword, $newPassword, $passwordRequired);
} else {
return $this->create($customer, $clearTextPassword);
}

return $this->create($customer, $clearTextPassword);
}

private function update(Customer $customer, $clearTextPassword, $newPassword, $passwordRequired = true)
Expand Down

0 comments on commit 31b896d

Please sign in to comment.