diff --git a/src/Mailchimp.php b/src/Mailchimp.php index a4dc660..ed63ecd 100644 --- a/src/Mailchimp.php +++ b/src/Mailchimp.php @@ -273,12 +273,14 @@ public function verifiedDomains($domain_name = null) * * @param $client_id * @param $redirect_uri + * @param $state * * @return string */ public static function getAuthUrl( $client_id, - $redirect_uri + $redirect_uri, + $state = null ) { $encoded_uri = urlencode($redirect_uri); @@ -287,6 +289,10 @@ public static function getAuthUrl( $authUrl .= "&redirect_uri=" . $encoded_uri; $authUrl .= "&response_type=code"; + if ($state !== null) { + $authUrl .= "&state=" . $state; + } + return $authUrl; }