2017-02-16 26 views
-1

我使用下列庫:的NodeJS - 缺少)後的參數列表

https://github.com/leftmostcat/passport-oauth2-password-grant

我試圖實現自己的例子:當運行應用程序

passport.use(new PasswordGrantStrategy({ 
    tokenURL: 'https://www.example.com/oauth2/token', 
    clientID: EXAMPLE_CLIENT_ID 
}, 
function(accessToken, refreshToken, profile, done) { 
    console.log(refreshToken); 
}); 

,我出現以下錯誤:

SyntaxError: missing) after argument list

這個問題來自哪裏?我看不到這個代碼中有錯誤。

+2

嘗試用棉短絨等eslint防止這種情況再次發生。 –

+0

語法錯誤,缺少右括號 – bvmCoder

回答

3

您不關閉passport.use(

passport.use(new PasswordGrantStrategy({ 
    tokenURL: 'https://www.example.com/oauth2/token', 
    clientID: EXAMPLE_CLIENT_ID 
    }, 
    function(accessToken, refreshToken, profile, done) { 
    console.log(refreshToken); 
    }));