我不確定Twilio Authy的register_user()
的成功回調是否正在解僱。在我的代碼Twilio Authy回調問題
var authyUsrId;
//global.authyUsrId;
app.post('/forTwilio', function(req, res){
// send the received data to Twilio Authy
authy.register_user('[email protected]', '8753565612', '91', function(err, res){
//global.authyUsrId = 'world';
authyUsrId = 'world';
});
//res.set("Content-Type","application/json");
res.json({name: 'hello', msg: authyUsrId});
//res.json({name: 'hello', msg: global.authyUsrId});
});
雖然新用戶被成功添加到Authy和響應狀態是200
我想authyUsrId的值設置爲東西的register_user()
的成功回調,並用它在我發送給POST請求的JSON響應。
但在迴應我得到只有這
{name: 'hello'}
有什麼辦法來調試尤其是register_user()回調部分?
謝謝@philnash。這真的很有幫助。 – somnathbm