Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
Update AuthController.php (#873)
Browse files Browse the repository at this point in the history
Turbulinks fixes
  • Loading branch information
Vitaly authored Jul 9, 2021
1 parent 4cbc2d2 commit 128dae7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/ShopifyApp/Traits/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ trait AuthController
public function authenticate(Request $request, AuthenticateShop $authShop)
{
// Get the shop domain
if (Util::getShopifyConfig('turbo_enabled') && $request->user()) {
// If the user clicked on any link before load Turbo and receiving the token
$shopDomain = $request->user()->getDomain();
$shopDomain = $request->has('shop')
? ShopDomain::fromNative($request->get('shop'))
: $request->user()->getDomain();

// If the domain is obtained from $request->user()
if ($request->missing('shop')) {
$request['shop'] = $shopDomain->toNative();
} else {
$shopDomain = ShopDomain::fromNative($request->get('shop'));
}

// Run the action
Expand Down

0 comments on commit 128dae7

Please sign in to comment.