Remove phoneCode function & debugs
This commit is contained in:
parent
beeb6207fc
commit
ad0a0c9621
1 changed files with 0 additions and 15 deletions
|
|
@ -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'})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue