Skip to content

Commit

Permalink
feat: add oauth support for ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
manisha1997 committed Dec 9, 2024
1 parent 5a1ff9d commit 711b3d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 0 additions & 2 deletions cluster_oauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'twilio-ruby'
require './lib/twilio-ruby/credential/client_credential_provider'

# rubocop:disable Metrics/BlockLength
describe 'Cluster Test' do
before(:each) do
@account_sid = ENV['TWILIO_ACCOUNT_OAUTH_SID']
Expand Down Expand Up @@ -63,4 +62,3 @@
expect(response.emails[0]['type']).to_not be_nil
end
end

3 changes: 2 additions & 1 deletion examples/public_oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
require 'twilio-ruby/credential/client_credential_provider'

credential_provider = Twilio::REST::ClientCredentialProvider.new(ENV['CLIENT_ID'], ENV['CLIENT_SECRET'])
client = Twilio::REST::Client.new(ENV['ACCOUNT_SID']).credential_provider(credential_provider) # passing account sid is not mandatory
# passing account sid is not mandatory
client = Twilio::REST::Client.new(ENV['ACCOUNT_SID']).credential_provider(credential_provider)

# send messages
client.messages.create(
Expand Down

0 comments on commit 711b3d0

Please sign in to comment.