Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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