Skip to content

Commit b9dfa69

Browse files
committed
Added $return variable in place of $redirect to simplify the code.
1 parent 7a751b5 commit b9dfa69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/AuthHelper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ public static function verifyShopifyRequest()
8282
* @param string $redirectUrl
8383
* @param string $state
8484
* @param string[] $options
85-
* @param bool $redirect
85+
* @param bool $return If true, will return the authentical url instead of auto-redirecting to the page.
8686
* @throws SdkException if required configuration is not provided in $config
8787
*
8888
* @return void|string
8989
*/
90-
public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $redirect = null)
90+
public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $return = false)
9191
{
9292
$config = ShopifySDK::$config;
9393

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

124-
if (!is_null($redirect)) {
124+
if ($return) {
125125
return $authUrl;
126126
}
127127

0 commit comments

Comments
 (0)