Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIError: Code №5 - User authorization failed: invalid access_token (4) #209

Closed
roledxd opened this issue Oct 4, 2019 · 3 comments
Closed

Comments

@roledxd
Copy link

roledxd commented Oct 4, 2019

{ APIError: Code №5 - User authorization failed: invalid access_token (4).
at API.callMethod (C:\Users\erer\Desktop\erer\node_modules\vk-io\lib\index.js:1764:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
code: 5,
name: 'APIError',
params:
[ { key: 'method', value: 'groups.getById' },
{ key: 'oauth', value: '1' },
{ key: 'v', value: '5.101' } ] }

const { VK } = require('vk-io'); const token = 'мой токен'; const vk = new VK({ token: process.env.token });

@NovaStream2030
Copy link

Может так: const { VK } = require('vk-io'); const vk = new VK({ token: 'токен }); ?

@negezor
Copy link
Owner

negezor commented Oct 5, 2019

В вашем коде токен будет браться из process.env.token, а не из переменной token.

const { VK } = require('vk-io');

const token = 'мой токен';

const vk = new VK({ token });

@negezor
Copy link
Owner

negezor commented Oct 8, 2019

Я закрою этот вопрос из-за не активности, не стесняйтесь открыть его снова.

@negezor negezor closed this as completed Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants