gnikyt / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
1.24k stars 374 forks source link

Authentication error #662

Closed SFD153 closed 3 years ago

SFD153 commented 3 years ago

I am getting Authentication error.

/home/glaxerco/public_html/vendor/osiset/laravel-shopify/src/ShopifyApp/Http/Middleware/AuthShopify.php

    // No shop domain found in any source
    return NullShopDomain::fromNative(null);
}

/**
 * Handle bad verification by killing the session and redirecting to auth.
 *
 * @param Request         $request The request object.
 * @param ShopDomainValue $domain  The shop domain.
 *
 * @throws MissingShopDomainException
 *
 * @return RedirectResponse
 */
private function handleBadVerification(Request $request, ShopDomainValue $domain)
{
    if ($domain->isNull()) {
        // We have no idea of knowing who this is, this should not happen
        throw new MissingShopDomainException();
    }

    // Set the return-to path so we can redirect after successful authentication
    Session::put('return_to', $request->fullUrl());

    // Kill off anything to do with the session
    $this->shopSession->forget();

    // Mis-match of shops
    return Redirect::route(
        $this->getConfig('route_names.authenticate.oauth'),
        ['shop' => $domain->toNative()]
    );
}

}

gnikyt commented 3 years ago

Please use template, but most likely this is related to issue 522

SFD153 commented 3 years ago

Thanks for your reply. Can you tell me how I can use your package without issue?

If you send me shopify-app.php file that you used in laravel, I will thank you very much.

SFD153 commented 3 years ago

I sent you message through your email (tyler@osiset.com) Could you please check?

gnikyt commented 3 years ago

I dont reply to emails. Your issue is missing the template so I can't provide you any info, but given its an auth error its most likely related to the cookie issues, which has no released fix yet.

SFD153 commented 3 years ago

Could you please help me with installation of that package from first?

SFD153 commented 3 years ago

In shopify-app.php, I put the codes below...

'scripttags' => [ [ 'src' => env('SHOPIFY_SCRIPTTAG_1_SRC', 'https://glaxerco.uk/some-controller/js-method-response'), 'event' => env('SHOPIFY_SCRIPTTAG_1_EVENT', 'onload'), 'display_scope' => env('SHOPIFY_SCRIPTTAG_1_DISPLAY_SCOPE', 'online_store') ],

],