Skip to content

Commit

Permalink
Fix token issue (#30)
Browse files Browse the repository at this point in the history
* Fix token issue, maybe

* wip

* wip
  • Loading branch information
datashaman authored Jan 25, 2021
1 parent 48c7466 commit e5988f0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/ServiceBusChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,13 @@ function () {
]
);

switch ($response->getStatusCode()) {
case 200:
$json = json_decode((string) $response->getBody());
$body = json_decode((string) $response->getBody(), true);

$code = (int) Arr::get($body, 'code', $response->getStatusCode());

return $json->token;
switch ($code) {
case 200:
return $body['token'];
default:
throw CouldNotSendNotification::loginFailed($response);
}
Expand Down

0 comments on commit e5988f0

Please sign in to comment.