Skip to content

Commit

Permalink
fix post oauth token method
Browse files Browse the repository at this point in the history
  • Loading branch information
lanlin committed Nov 23, 2021
1 parent d195fae commit 9c7f7e3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions src/Authentication/Hosted.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* ----------------------------------------------------------------------------------
*
* @author lanlin
* @change 2020/06/24
* @change 2021/11/23
*/
class Hosted
{
Expand Down Expand Up @@ -81,14 +81,12 @@ public function postOAuthToken(string $code): array

$params = $this->options->getClientApps();

$params['code'] = $code;

$query = ['grant_type' => 'authorization_code'];
$query = \array_merge($query, $params);
$params['code'] = $code;
$params['grant_type'] = 'authorization_code';

return $this->options
->getSync()
->setQuery($query)
->setFormParams($params)
->post(API::LIST['oAuthToken']);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Webhooks/Webhook.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(Options $options)
// ------------------------------------------------------------------------------

/**
* echo challenge to validate webhook
* echo challenge to validate webhook (for fpm mode)
*
* TIPS: you'd better use the output method from your framework.
*/
Expand All @@ -60,7 +60,7 @@ public function echoChallenge(): void
// ------------------------------------------------------------------------------

/**
* get notification & parse it
* get notification & parse it (for fpm mode)
*
* @return array
* [
Expand Down Expand Up @@ -90,7 +90,7 @@ public function getNotification(): array
// ------------------------------------------------------------------------------

/**
* webhook X-Nylas-Signature header verification
* webhook X-Nylas-Signature header verification (for other mode)
*
* @see https://docs.nylas.com/reference#receiving-notifications
*
Expand Down

0 comments on commit 9c7f7e3

Please sign in to comment.