Code Monkey home page Code Monkey logo

Comments (10)

7even avatar 7even commented on July 25, 2024

Пока такой возможности нет, это архитектурный косяк. Подумаю, как это исправить.

from vkontakte_api.

Ajaxy avatar Ajaxy commented on July 25, 2024

Я могу какой-то workaround у себя сейчас запилить?

from vkontakte_api.

7even avatar 7even commented on July 25, 2024

Если токен приходит "извне" (т.е. не через VkontakteApi.authorize), то можно перед каждым вызовом метода API делать VkontakteApi.configure с нужными настройками - коряво, но должно работать.

from vkontakte_api.

Ajaxy avatar Ajaxy commented on July 25, 2024

Спасибо.

from vkontakte_api.

Ajaxy avatar Ajaxy commented on July 25, 2024

Есть какие-нибудь новости тут?
Можно ли вызывать каждый раз VkontakteApi.configure + VkontakteApi.authorize перед каждым запросом?

from vkontakte_api.

7even avatar 7even commented on July 25, 2024

Новостей нет, выполнять configure и authorize можно. Только, наверно, не перед каждым запросом, а при переключении между App Id.

from vkontakte_api.

Ajaxy avatar Ajaxy commented on July 25, 2024

Переключение через configure на практике не работает. Почему, выяснить не удалось. Но access_token после повторного вызова configure с другими данными получается неверный (VK возвращает ошибку).

from vkontakte_api.

voodee avatar voodee commented on July 25, 2024

Срабатывает только один раз:

>> VkontakteApi.configure{|c| c.app_id = 000; c.app_secret=""; }
VkontakteApi
>> @vk = VkontakteApi.authorize(type: :app_server)
OAuth2::Error: invalid_client: client_secret is undefined

При повторных вызовах VkontakteApi.configure app_secret не меняется.

В gemfile:
gem 'vkontakte_api', github: '7even/vkontakte_api', branch: 'master'

from vkontakte_api.

7even avatar 7even commented on July 25, 2024

Скорее всего, проблема в этой строчке.

Как временный костыль, можно попробовать сделать VkontakteApi.instance_variable_set(:@client, nil) перед вызовом VkontakteApi.configure.

from vkontakte_api.

voodee avatar voodee commented on July 25, 2024

Да, так работает. Спасибо!

from vkontakte_api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.