fix(medusa): Normalizes email before saving customer (#1719)

This commit is contained in:
Sebastian Rindom
2022-06-27 10:56:12 +02:00
committed by GitHub
parent 89cb717461
commit 2a32609b74
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -258,6 +258,7 @@ class CustomerService extends TransactionBaseService<CustomerService> {
this.customerRepository_
)
customer.email = customer.email.toLowerCase()
const { email, password } = customer
const existing = await this.retrieveByEmail(email).catch(() => undefined)
@@ -289,7 +290,7 @@ class CustomerService extends TransactionBaseService<CustomerService> {
delete customer.password
}
const created = await customerRepository.create(customer)
const created = customerRepository.create(customer)
const result = await customerRepository.save(created)
await this.eventBusService_
.withTransaction(manager)