From 11db52d4adb57ac3a68732eb1033cab6c13dda6e Mon Sep 17 00:00:00 2001 From: jvedrson Date: Mon, 8 Jul 2024 16:24:36 -0400 Subject: [PATCH] feat: allow to search user by email in the gateway routes --- src/app/routes/gateway.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/routes/gateway.js b/src/app/routes/gateway.js index 30456b8c..bb9a6f8b 100644 --- a/src/app/routes/gateway.js +++ b/src/app/routes/gateway.js @@ -121,6 +121,12 @@ module.exports = (Router, Service) => { }); }); + Router.post('/gateway/user/findByEmail', basicAuth, async (req, res) => { + const email = req.body.email.toLowerCase(); + const user = await Service.User.FindUserByEmail(email).catch(() => null); + return res.status(200).send({ error: null, user }); + }); + Router.post('/gateway/register/stage', basicAuth, (req, res) => { const { email } = req.body; Service.User.CreateStaggingUser(email)