Skip to content

Commit

Permalink
Merge pull request #35 from ChristopherCarranza/feature/SeparateAccou…
Browse files Browse the repository at this point in the history
…ntSID

Updated config names to match TwilioService. Added ability to explici…
  • Loading branch information
fwartner committed Feb 15, 2018
2 parents aacc86e + cd6fa05 commit a45d5be
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -49,8 +49,9 @@ Add your Twilio Account SID, Auth Token, and From Number (optional) to your `con
// config/services.php
...
'twilio' => [
'account_sid' => env('TWILIO_ACCOUNT_SID'),
'auth_token' => env('TWILIO_AUTH_TOKEN'),
'username' => env('TWILIO_USERNAME'),
'password' => env('TWILIO_PASSWORD'),
'account_sid' => env('TWILIO_ACCOUNT_SID'), //optional
'from' => env('TWILIO_FROM'), // optional
],
...
Expand Down
30 changes: 20 additions & 10 deletions src/TwilioConfig.php
Expand Up @@ -19,24 +19,34 @@ public function __construct(array $config)
$this->config = $config;
}

/**
* Get the account sid.
*
* @return string
*/
public function getAccountSid()
/**
* Get the username.
*
* @return string
*/
public function getUsername()
{
return $this->config['account_sid'];
return $this->config['username'];
}

/**
* Get the password.
*
* @return string
*/
public function getPassword()
{
return $this->config['password'];
}

/**
* Get the auth token.
* Get the account sid.
*
* @return string
*/
public function getAuthToken()
public function getAccountSid()
{
return $this->config['auth_token'];
return $this->config['account_sid'];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/TwilioProvider.php
Expand Up @@ -23,7 +23,7 @@ public function boot()

$this->app->bind(TwilioService::class, function () {
$config = $this->app['config']['services.twilio'];
return new TwilioService($config['account_sid'], $config['auth_token']);
return new TwilioService($config['username'], $config['password'], $config['account_sid']);
});
}

Expand Down

1 comment on commit a45d5be

@jdavidbakr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this commit as it removes the auth-token which would be more secure than using your username and password?

Please sign in to comment.