From 437bfb2ff84fd73f743220f174c64a9c5f6e9ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 19 Sep 2022 09:04:47 +0800 Subject: Remove what didn't work --- hooks/authenticatedFetch.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 hooks/authenticatedFetch.js diff --git a/hooks/authenticatedFetch.js b/hooks/authenticatedFetch.js deleted file mode 100644 index 111bb8b..0000000 --- a/hooks/authenticatedFetch.js +++ /dev/null @@ -1,23 +0,0 @@ -async function authenticatedFetch(uri, options) { - var AppBridge = window['app-bridge']; - var app = AppBridge.createApp({ - apiKey: '', - host: '' - }); - var fetchFunction = window['app-bridge-utils'].authenticatedFetch(app); - var response = await fetchFunction(uri, options); - var headers = response.headers; - if (headers.get("X-Shopify-API-Request-Failure-Reauthorize") - === "1") { - var authUrlHeader = headers.get( - "X-Shopify-API-Request-Failure-Reauthorize-Url") - || `/api/auth`; - var Redirect = AppBridge.actions.Redirect; - Redirect.create(app).dispatch(Redirect.Action.REMOTE, - authUrlHeader.startsWith("/") - ? `https://${window.location.host}${authUrlHeader}` - : authUrlHeader - ); - } - return response; -} -- cgit v1.2.3