D
D
Dmitry2015-05-07 12:01:28
Node.js
Dmitry, 2015-05-07 12:01:28

How to handle authentication errors in passport-facebook and passport-vkontakte?

Actually, this question is continued . Why does VKontakte authentication through passport-vkontakte not always work?
How to properly handle authentication errors through social. networks? So that the user is redirected to the authorization page instead of the error page?

InternalOAuthError: failed to fetch user profile
    at /home/www/workspace/node_modules/passport-vkontakte/lib/passport-vkontakte/strategy.js:144:28
    at ClientRequest.<anonymous> (/home/www/workspace/node_modules/passport-vkontakte/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:148:5)
    at ClientRequest.emit (events.js:107:17)
    at TLSSocket.socketErrorListener (_http_client.js:272:9)
    at TLSSocket.emit (events.js:129:20)
    at net.js:451:14
    at process._tickCallback (node.js:355:11)


InternalOAuthError: Failed to obtain access token
    at Strategy.OAuth2Strategy._createOAuthError (/home/www/workspace/node_modules/passport-vkontakte/node_modules/passport-oauth2/lib/strategy.js:349:17)
    at /home/www/workspace/node_modules/passport-vkontakte/node_modules/passport-oauth2/lib/strategy.js:171:43
    at /home/www/workspace/node_modules/passport-vkontakte/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:177:18
    at ClientRequest.<anonymous> (/home/www/workspace/node_modules/passport-vkontakte/node_modules/passport-oauth2/node_modules/oauth/lib/oauth2.js:148:5)
    at ClientRequest.emit (events.js:107:17)
    at TLSSocket.socketErrorListener (_http_client.js:272:9)
    at TLSSocket.emit (events.js:129:20)
    at net.js:451:14
    at process._tickCallback (node.js:355:11)

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