2017-02-16 27 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); 
    }));