Feature: Create conversations from Tweets (#470)

* Feature: Add tweets to conversations
This commit is contained in:
Pranav Raj S 2020-02-09 15:47:48 +05:30 committed by GitHub
parent 3465ebefd1
commit 272c481464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 333 additions and 68 deletions

View file

@ -13,7 +13,7 @@ class Api::V1::WebhooksController < ApplicationController
end
def twitter_crc
render json: { response_token: "sha256=#{$twitter.generate_crc(params[:crc_token])}" }
render json: { response_token: "sha256=#{twitter_client.generate_crc(params[:crc_token])}" }
end
def twitter_events
@ -26,6 +26,12 @@ class Api::V1::WebhooksController < ApplicationController
private
def twitter_client
Twitty::Facade.new do |config|
config.consumer_secret = ENV.fetch('TWITTER_CONSUMER_SECRET', nil)
end
end
def login_from_basic_auth
authenticate_or_request_with_http_basic do |username, password|
username == ENV['CHARGEBEE_WEBHOOK_USERNAME'] && password == ENV['CHARGEBEE_WEBHOOK_PASSWORD']