File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1212 * ----------------------------------------------------------------------------------
1313 *
1414 * @author lanlin
15- * @change 2020/06/24
15+ * @change 2021/11/23
1616 */
1717class Hosted
1818{
@@ -81,14 +81,12 @@ public function postOAuthToken(string $code): array
8181
8282 $ params = $ this ->options ->getClientApps ();
8383
84- $ params ['code ' ] = $ code ;
85-
86- $ query = ['grant_type ' => 'authorization_code ' ];
87- $ query = \array_merge ($ query , $ params );
84+ $ params ['code ' ] = $ code ;
85+ $ params ['grant_type ' ] = 'authorization_code ' ;
8886
8987 return $ this ->options
9088 ->getSync ()
91- ->setQuery ( $ query )
89+ ->setFormParams ( $ params )
9290 ->post (API ::LIST ['oAuthToken ' ]);
9391 }
9492
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function __construct(Options $options)
3939 // ------------------------------------------------------------------------------
4040
4141 /**
42- * echo challenge to validate webhook
42+ * echo challenge to validate webhook (for fpm mode)
4343 *
4444 * TIPS: you'd better use the output method from your framework.
4545 */
@@ -60,7 +60,7 @@ public function echoChallenge(): void
6060 // ------------------------------------------------------------------------------
6161
6262 /**
63- * get notification & parse it
63+ * get notification & parse it (for fpm mode)
6464 *
6565 * @return array
6666 * [
@@ -90,7 +90,7 @@ public function getNotification(): array
9090 // ------------------------------------------------------------------------------
9191
9292 /**
93- * webhook X-Nylas-Signature header verification
93+ * webhook X-Nylas-Signature header verification (for other mode)
9494 *
9595 * @see https://docs.nylas.com/reference#receiving-notifications
9696 *
You can’t perform that action at this time.
0 commit comments