0
このコードは他の状況でも動作しますが、ファイルの設定が問題の原因となっていると思いますが、回避方法がわかりません。それは契約業務なので、私はfilの設定を変更する能力がなく、このエラーを修正する方法がわかりません。CALL_NON_FUNCTION_AS_CONSTRUCTOR(native)NodeJS
は、私はここからのOAuthモジュールを呼んでいる:exports.OAuth2
などの各機能の輸出として
のOAuthモジュール(ネイティブ)CALL_NON_FUNCTION_AS_CONSTRUCTOR:
var common = require('common');
var OAuth2 = require('oauth2');
var google = require('google');
exports.init = function(app) {
app.get('/oauth/google', function(req, res) {
var gmailAuthObject =
new OAuth2(google.clientId,
google.clientSecret,
'',
'https://accounts.google.com/o/oauth2/auth',
'https://accounts.google.com/o/oauth2/token');
var redirectUrl = gmailAuthObject.getAuthorizeUrl(
{ redirect_uri:google.callbackRedirect,
scope:'https://www.google.com/m8/feeds',
response_type:'code',
access_type:'offline' });
res.redirect(redirectUrl);
});
app.get('/oauth/google/callback', function(req, res) {
var code = req.query.code;
var content = '<script>' +
'window.opener.SITENAME.setGoogleCode("' + code + '");' +
'window.close();' +
'</script>';
res.writeHeader(200, {"Content-Type": "text/html"});
res.end(content, 'utf-8');
});
// Other Networks...
/******************************************************************************/
};
それが持つ新しいのOAuth2で失敗しています。
exports.init
の中に問題があると推測していますが、修正できません。任意のアイデアやここで助けてください?ありがとう!
ハハ、うんそれはそれです。私はちょうどそれを理解して、自分の質問に答えていた。明らかに愚かな一日を持つ。ご協力いただきありがとうございます。 – Brandon