From e844f4a5b72317ea4990c6e83501e168aba0c257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82?= Date: Wed, 2 Mar 2022 10:18:11 +0100 Subject: [PATCH] fix: exists flag on /store/auth/:email endpoint (#1122) --- packages/medusa/src/api/routes/store/auth/exists.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/medusa/src/api/routes/store/auth/exists.ts b/packages/medusa/src/api/routes/store/auth/exists.ts index bfa11c3729..980d1c835d 100644 --- a/packages/medusa/src/api/routes/store/auth/exists.ts +++ b/packages/medusa/src/api/routes/store/auth/exists.ts @@ -24,8 +24,10 @@ export default async (req, res) => { try { const customerService: CustomerService = req.scope.resolve("customerService") - const customer = await customerService.retrieveByEmail(email) - res.status(200).json({ exists: !!customer.password_hash }) + const customer = await customerService.retrieveByEmail(email, { + select: ["has_account"], + }) + res.status(200).json({ exists: customer.has_account }) } catch (err) { res.status(200).json({ exists: false }) }