S
S
Sasha Yashchuk2019-05-08 21:31:57
API
Sasha Yashchuk, 2019-05-08 21:31:57

How to correctly set passport-vkontakte verify callback when deploying an application on heroku?

Good day to all!
Help to deploy the application on Heroku.
The application logs in using passport-vkontakte, which requires you to specify a callback. I pointed

`http://${config.get('server.host')}:${config.get('server.port')}/auth/vkontakte/callback`

In my config file I have:
server: {
        port: process.env.PORT || 8888,
        host: process.env.host || 'localhost'
    }

and when run locally, everything works fine, but when run on Heroku, the callback looks like this:
localhost:44834/auth/vkontakte/callback?code=21ed6...
which, accordingly, leads to an error.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-05-08
@grinat

Should VK knock there? Remove Host and port, in my opinion, in order to get data about the host, additional metadata must be included, and somewhere in proccess.env there will be a variable with the host.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question