feat(medusa): Claim customer orders (#2710)
This commit is contained in:
1 parent
86f9455d00
commit
a6243618fe
36 files changed
+872
-107
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user