feat(medusa): Claim customer orders (#2710)

This commit is contained in:
Philip Korsholm authored and GitHub committed 2022-12-08 17:48:49 +01:00
1 parent 86f9455d00
commit a6243618fe
36 files changed
+872 -107

No files matched your search

+6 -6
View File
@@ -149,21 +149,21 @@ class AuthService extends TransactionBaseService {
): Promise<AuthenticateResult> {
return await this.atomicPhase_(async (transactionManager) => {
try {
const customerPasswordHash: Customer = await this.customerService_
const customer: Customer = await this.customerService_
.withTransaction(transactionManager)
.retrieveByEmail(email, {
select: ["password_hash"],
.retrieveRegisteredByEmail(email, {
select: ["id", "password_hash"],
})
if (customerPasswordHash.password_hash) {
if (customer.password_hash) {
const passwordsMatch = await this.comparePassword_(
password,
customerPasswordHash.password_hash
customer.password_hash
)
if (passwordsMatch) {
const customer = await this.customerService_
.withTransaction(transactionManager)
.retrieveByEmail(email)
.retrieveRegisteredByEmail(email)
return {
success: true,