|
|
@ -112,13 +112,17 @@ function createQRCode(telegram, done) { |
|
|
|
where: { |
|
|
|
telegram: telegram |
|
|
|
} |
|
|
|
}).then(user => { |
|
|
|
}) |
|
|
|
.then(user => { |
|
|
|
refreshVerification(user, result => { |
|
|
|
const verifyURL = `${process.env.WEBSITE_URL}/#/verify/${encodeURIComponent(result.verification)}`; |
|
|
|
QRCode.toDataURL(verifyURL, { width: 300, height: 300 }, (err, url) => { |
|
|
|
done(err, url); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
done(err); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -227,7 +231,7 @@ app.get('/code', (req, res) => { |
|
|
|
return; |
|
|
|
} |
|
|
|
createQRCode(req.session.user, (err, url) => { |
|
|
|
res.send({ error: err, data: url }); |
|
|
|
res.status(url ? 200 : 401).send({ error: err, data: url }); |
|
|
|
}); |
|
|
|
}) |
|
|
|
|
|
|
|