Skip to content

Commit e73582b

Browse files
committed
add support for OAuth state variable
1 parent 56e10b2 commit e73582b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Mailchimp.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,14 @@ public function verifiedDomains($domain_name = null)
273273
*
274274
* @param $client_id
275275
* @param $redirect_uri
276+
* @param $state
276277
*
277278
* @return string
278279
*/
279280
public static function getAuthUrl(
280281
$client_id,
281-
$redirect_uri
282+
$redirect_uri,
283+
$state = null
282284
) {
283285
$encoded_uri = urlencode($redirect_uri);
284286

@@ -287,6 +289,10 @@ public static function getAuthUrl(
287289
$authUrl .= "&redirect_uri=" . $encoded_uri;
288290
$authUrl .= "&response_type=code";
289291

292+
if ($state !== null) {
293+
$authUrl .= "&state=" . $state;
294+
}
295+
290296
return $authUrl;
291297
}
292298

0 commit comments

Comments
 (0)