fix: exists flag on /store/auth/:email endpoint (#1122)
This commit is contained in:
1 parent
4b4463f0e2
commit
e844f4a5b7
1 file changed
+4
-2
@@ -24,8 +24,10 @@ export default async (req, res) => {
|
|||||||
try {
|
try {
|
||||||
const customerService: CustomerService =
|
const customerService: CustomerService =
|
||||||
req.scope.resolve("customerService")
|
req.scope.resolve("customerService")
|
||||||
const customer = await customerService.retrieveByEmail(email)
|
const customer = await customerService.retrieveByEmail(email, {
|
||||||
res.status(200).json({ exists: !!customer.password_hash })
|
select: ["has_account"],
|
||||||
|
})
|
||||||
|
res.status(200).json({ exists: customer.has_account })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
res.status(200).json({ exists: false })
|
res.status(200).json({ exists: false })
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user