D
D
Dmitry2015-05-05 15:39:08
Node.js
Dmitry, 2015-05-05 15:39:08

Why doesn't passport-vkontakte work?

I want to make authentication through VK ...
By code:

VKontakteStrategy = require('passport-vkontakte'),
....

passport.use(new VKontakteStrategy({
        clientID:     VKONTAKTE_APP_ID, 
        clientSecret: VKONTAKTE_APP_SECRET,
        callbackURL:  "https://local:8081/auth/vkontakte/callback"
      },
      function(accessToken, refreshToken, profile, done) {
            process.nextTick(function () {
              return done(null, profile);
            });
          }
        ));

I get an error when starting the application
/home/app.js:349
    passport.use(new VKontakteStrategy({
                 ^
TypeError: object is not a function
    at Object.<anonymous> (/home/app.js:349:15)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.runMain [as _onTimeout] (module.js:501:10)
    at Timer.listOnTimeout (timers.js:110:15)

Does anyone have any ideas what is causing the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2015-05-05
@falcon_sapsan

A banal typo before loading the module (
One more thing
needs to be replaced
with

VKontakteStrategy = require('passport-vkontakte').Strategy;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question