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에 성공적으로 추가되고 있으며, 응답 상태 내가 register_user()
의 성공 콜백에서 뭔가 authyUsrId의 값을 설정하고 그것을 사용하려면 200
이지만 POST 요청에 보내는 JSON 응답
그러나
는 응답에 나는 점점 오전에만이{name: 'hello'}
특히 register_user() 콜백 부분을 디버깅 할 수있는 방법이 있나요?
감사합니다. @philnash. 정말 도움이되었습니다. – somnathbm