summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 09:04:47 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2022-09-19 09:04:47 +0800
commit437bfb2ff84fd73f743220f174c64a9c5f6e9ba5 (patch)
treef5fc7377989a0f4761fc93e3c7a342feeaa3c9b2
parentf6032cd02992dc35dcf4bc67a6fbe83eb78ad39e (diff)
Remove what didn't work
-rw-r--r--hooks/authenticatedFetch.js23
1 files changed, 0 insertions, 23 deletions
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;
-}