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

Turbulinks fixes #873

Merged
merged 1 commit into from Jul 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't feel very safe

also where did the check if turbo is even enabled go?

? 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