Shopify app online access token mode in php Laravel template

We are developing an app based on the php laravel template of the shopify CLI, almost every thing working as expected until now, but as we move forwards we might have interest to use the “online access mode” rather than the default offline mode, and based on this info https://github.com/Shopify/shopify-api-php/blob/main/docs/usage/oauth.md I assumed that I could just change the present default configuration to online and this would just work, I change the default access mode in the “EnsureShopifySession” class to
“ACCESS_MODE_ONLINE” but unfortunately the app OAuth didn’t like these changes and the app didn’t load and was redirecting me to an error

I would be glad to hear if someone knows how to use the “access online mode”

If anyone ever faces the same issue, I think I found the answer

in the

class EnsureShopifySession
change to

ACCESS_MODE_ONLINE
in the function

function handle(Request $request, Closure $next, string $accessMode = self::ACCESS_MODE_OFFLINE)

then in the

class AuthRedirection

change the default

bool $isOnline to true
in the function

public static function redirect(Request $request, bool $isOnline = false :disappointed_face: RedirectResponse

1 Like