Created
May 30, 2021 16:31
-
-
Save bibhuticoder/1717d43ec1a3235cc149340a1c232e3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.post('/api/verify-token', (req, res) => { | |
const { otp, request_id } = req.body; | |
if (!otp) return res.status(400).send({ message: "Otp is required" }); | |
if (!request_id) return res.status(400).send({ message: "Invalid request" }); | |
verifyOtp(request_id, otp, async (result) => { | |
if (result) { | |
// ... | |
res.send({ message: "Success" }); | |
} else { | |
// ... | |
return res.status(400).send({ message: `Error verifying OTP` }); | |
} | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment