M
M
michaelandreyev52017-06-01 12:48:15
In contact with
michaelandreyev5, 2017-06-01 12:48:15

How to add a request to vk api to an existing strategy?

There is a strategy:

passport.use('vk', new AuthVKStrategy({
        clientID: config.get("auth:vk:app_id"),
        clientSecret: config.get("auth:vk:secret"),
        callbackURL: config.get("app:url") + "/auth/vk/callback"
    },
    function (accessToken, refreshToken, profile, done) {

  
        
        return done(null, {
            username: profile.displayName,
            photoUrl: profile.photos[0].value,
            profileUrl: profile.profileUrl

        });
    }
));

There is a request like this:
https://api.vk.com/method/friends.get?user_id=some_id&order=random&count=5&access_token=ACCESS_TOKEN&v=5.64

How should it look together?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question