Skip to content

Commit

Permalink
Merge pull request #81 from mmorrisson/master
Browse files Browse the repository at this point in the history
add support for OAuth state variable
  • Loading branch information
Jhut89 authored Aug 24, 2020
2 parents 56e10b2 + e73582b commit dc05359
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Mailchimp.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
}

Expand Down

0 comments on commit dc05359

Please sign in to comment.