Remove phoneCode function & debugs

This commit is contained in:
goga-m 2017-09-12 20:07:59 +03:00 committed by Josh Harvey
parent beeb6207fc
commit ad0a0c9621

View file

@ -190,19 +190,6 @@ function pair (req, res, next) {
.catch(next) .catch(next)
} }
function phoneCode (req, res, next) {
const pi = plugins(req.settings, req.deviceId)
const phone = req.body.phone
return pi.getPhoneCode(phone)
.then(code => respond(req, res, {code}))
.catch(err => {
if (err.name === 'BadNumberError') throw httpError('Bad number', 410)
throw err
})
.catch(next)
}
function errorHandler (err, req, res, next) { function errorHandler (err, req, res, next) {
const statusCode = err.name === 'HTTPError' const statusCode = err.name === 'HTTPError'
? err.code || 500 ? err.code || 500
@ -298,8 +285,6 @@ app.get('/tx', getPhoneTx)
app.use(errorHandler) app.use(errorHandler)
app.use((req, res) => { app.use((req, res) => {
console.log('DEBUG98')
console.log(req.route)
res.status(404).json({error: 'No such route'}) res.status(404).json({error: 'No such route'})
}) })