Skip to content

Commit

Permalink
Added $return variable in place of $redirect to simplify the code.
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqtms committed Aug 28, 2018
1 parent 7a751b5 commit b9dfa69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/AuthHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ public static function verifyShopifyRequest()
* @param string $redirectUrl
* @param string $state
* @param string[] $options
* @param bool $redirect
* @param bool $return If true, will return the authentical url instead of auto-redirecting to the page.
* @throws SdkException if required configuration is not provided in $config
*
* @return void|string
*/
public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $redirect = null)
public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $return = false)
{
$config = ShopifySDK::$config;

Expand Down Expand Up @@ -121,7 +121,7 @@ public static function createAuthRequest($scopes, $redirectUrl = null, $state =
// https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri}&state={nonce}&grant_options[]={option}
$authUrl = $config['AdminUrl'] . 'oauth/authorize?client_id=' . $config['ApiKey'] . '&redirect_uri=' . $redirectUrl . "&scope=$scopes" . $state . $options;

if (!is_null($redirect)) {
if ($return) {
return $authUrl;
}

Expand Down

0 comments on commit b9dfa69

Please sign in to comment.