Skip to content

Commit

Permalink
add project_id specification on api urls
Browse files Browse the repository at this point in the history
  • Loading branch information
waylandzhang committed Dec 23, 2016
1 parent 4d03dee commit 085adf8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/K5/Token/Auth.php
Expand Up @@ -11,14 +11,16 @@ class Auth
public $password;
public $contract;
public $region;
public $project;

// if client side stored $token_passed is passed in, we just return it without making the request
public function __construct($username, $password, $contract, $region = '', $token_passed = false) {
public function __construct($username, $password, $contract, $region = '', $project = '', $token_passed = false) {
$this->username = $username;
$this->password = $password;
$this->contract = $contract;
$this->region = $region;
$this->token_passed = $token_passed;
$this->project = $project;
}


Expand Down Expand Up @@ -98,7 +100,12 @@ public function getAuthToken()

$return = json_decode($return, true);

$project_id = $this->getProjectId(json_decode($data));
if(!empty($this->project)){
$project_id = $this->project;
}else{
$project_id = $this->getProjectId(json_decode($data));
}

$domain_id = $this->getDomainId(json_decode($data));

return array(
Expand Down

0 comments on commit 085adf8

Please sign in to comment.