diff --git a/routes/public.ts b/routes/public.ts index a5c7bd132bd78b93e6f0c70777e69a80cc1c08d7..43b28e8a756df5fa8b942167dff51714e89d476d 100644 --- a/routes/public.ts +++ b/routes/public.ts @@ -92,6 +92,17 @@ export = function (app:any, config:any, lang:string) { ]) } }) + // to check whether or not an account is already exist + app.get('/email/:email', async function(req:any, res:any) { + let user = await methods.checkUserEmail(req.params.email) + if (!user) { + console.log('No user found: '+req.params.email) + res.send(true) + } else { + console.log('User found: '+req.params.email) + res.send(false) + } + }) // =================== USERS VERIFICATION =========================