diff --git a/app/Http/Controllers/ShopifyInstallController.php b/app/Http/Controllers/ShopifyInstallController.php deleted file mode 100644 index 4dc16e7..0000000 --- a/app/Http/Controllers/ShopifyInstallController.php +++ /dev/null @@ -1,57 +0,0 @@ -clientId = '1b6430c8cc94b5e58716235abd9bbd73'; - $this->clientSecret = config('services.shopify.webhook_secret'); - $this->shop = 'bluefootedboobyspices.myshopify.com'; - } - - public function install() - { - $callback = 'https://sms.spices.blue/shopify/callback'; - - $url = "https://{$this->shop}/admin/oauth/authorize" - . "?client_id={$this->clientId}" - . "&scope={$this->scopes}" - . "&redirect_uri=" . urlencode($callback) - . "&state=spicesetup"; - - return redirect($url); - } - - public function callback(Request $request) - { - $code = $request->query('code'); - - if (!$code) { - return response('Kein Code empfangen. ' . $request->getQueryString(), 400); - } - - $response = Http::post("https://{$this->shop}/admin/oauth/access_token", [ - 'client_id' => $this->clientId, - 'client_secret' => $this->clientSecret, - 'code' => $code, - ]); - - if ($response->failed()) { - return response('Token-Exchange fehlgeschlagen: ' . $response->body(), 500); - } - - $token = $response->json('access_token'); - - return response("
SHOPIFY_ACCESS_TOKEN={$token}");
- }
-}
diff --git a/routes/web.php b/routes/web.php
index a7114f5..11fa2c8 100644
--- a/routes/web.php
+++ b/routes/web.php
@@ -1,12 +1,7 @@