Skip to content

Prevent key generation for the same e-mail again - #8

Merged
adiXcodr merged 1 commit into
adiXcodr:masterfrom
paramsiddharth:master
Dec 9, 2020
Merged

adiXcodr merged 1 commit into
adiXcodr:masterfrom
paramsiddharth:master

Conversation

@paramsiddharth

Copy link
Copy Markdown
Contributor

Prevent key generation for the same e-mail again

Resolves #2: Prevent new key generation for already present emails

The only modification is in the routes/index.js file.

...
if(!jsonData || jsonData.length<1)
  jsonData=[];
if (jsonData.filter(x => x.email === req.props.email).length > 0)
  return res.json({ status: 'Failure', data: 'E-mail already exists.' });
...

This discontinues the key-generation if the e-mail address already exists.

@adiXcodr
adiXcodr merged commit 2f503f4 into adiXcodr:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants