Skip to content

Commit ccc2ab9

Browse files
#622 fix shopify auth (after 1 January 2026)
1 parent 79da11d commit ccc2ab9

File tree

11 files changed

+80
-131
lines changed

11 files changed

+80
-131
lines changed

src/core/integrations/integrations/integrations-create/IntegrationCreateController.vue

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ import {
4545
createWoocommerceSalesChannelMutation,
4646
getAmazonRedirectUrlMutation,
4747
getEbayRedirectUrlMutation,
48+
getShopifyRedirectUrlMutation,
4849
getSheinRedirectUrlMutation,
49-
refreshSalesChannelWebsitesMutation,
5050
} from '../../../../shared/api/mutations/salesChannels.js';
5151
import { createWebhookIntegrationMutation } from '../../../../shared/api/mutations/webhookIntegrations.js';
5252
import { Toast } from '../../../../shared/modules/toast';
@@ -479,7 +479,7 @@ const handleFinish = async () => {
479479
if (data && data[mutationKey]) {
480480
Toast.success(t('integrations.create.success'));
481481
loading.value = false;
482-
handleSalesChannelSuccess(data[mutationKey], resolvedIntegrationType.value);
482+
await handleSalesChannelSuccess(data[mutationKey], resolvedIntegrationType.value);
483483
}
484484
} catch (err) {
485485
loading.value = false;
@@ -498,7 +498,6 @@ const handleFinish = async () => {
498498
const handleShopifySalesChannelSuccess = async (channelData: any) => {
499499
const id = channelData.id;
500500
501-
/*
502501
const { data } = await apolloClient.mutate({
503502
mutation: getShopifyRedirectUrlMutation,
504503
variables: {
@@ -513,29 +512,15 @@ const handleShopifySalesChannelSuccess = async (channelData: any) => {
513512
return;
514513
}
515514
516-
// If we have errors from OperationInfo
517515
const messages = result?.messages || [];
518-
messages.forEach((msg: any) => {
519-
Toast.error(msg.message);
520-
});
521-
*/
522-
try {
523-
loading.value = true;
524-
await apolloClient.mutate({
525-
mutation: refreshSalesChannelWebsitesMutation,
526-
variables: {
527-
data: { id },
528-
},
516+
if (messages.length) {
517+
messages.forEach((msg: any) => {
518+
Toast.error(msg.message);
529519
});
530-
Toast.success(t("integrations.show.pullData.success"));
531-
} catch (error) {
532-
Toast.error(t("integrations.show.pullData.error"));
533-
console.error("Pull data failed:", error);
534-
} finally {
535-
loading.value = false;
520+
} else {
521+
Toast.error(t('integrations.salesChannel.shopify.installed.genericError'));
536522
}
537523
538-
// Redirect to show page anyway
539524
router.push({
540525
name: 'integrations.integrations.show',
541526
params: { type: IntegrationTypes.Shopify, id },

src/core/integrations/integrations/integrations-create/containers/integration-specific-step/shopify/ShopifyChannelInfoStep.vue

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<script setup lang="ts">
2-
import { computed, defineProps } from 'vue';
2+
import { computed } from 'vue';
33
import { useI18n } from 'vue-i18n';
44
import { Label } from "../../../../../../../shared/components/atoms/label";
5-
import { TextInput } from "../../../../../../../shared/components/atoms/input-text";
65
import { ShopifyChannelInfo } from '../../../../integrations';
76
import { Icon } from "../../../../../../../shared/components/atoms/icon";
87
import { Button } from "../../../../../../../shared/components/atoms/button";
@@ -14,7 +13,7 @@ import {
1413
FieldQuery
1514
} from "../../../../../../../shared/components/organisms/general-form/containers/form-fields/field-query";
1615
17-
const props = defineProps<{
16+
defineProps<{
1817
channelInfo: ShopifyChannelInfo
1918
}>();
2019
@@ -48,74 +47,40 @@ const propertyField = computed(() => ({
4847
<template>
4948
<div>
5049
<h1 class="text-2xl text-center mb-2">
51-
{{ t('integrations.create.wizard.step4.magento.content') }}
50+
{{ t('integrations.create.wizard.step4.shopify.content') }}
5251
</h1>
5352
<hr/>
5453
<Flex vertical>
5554
<FlexCell>
5655
<Flex class="mt-4 gap-4" center>
5756
<FlexCell center>
58-
<Flex vertical class="gap-2">
57+
<Flex vertical class="gap-4">
5958
<FlexCell>
60-
<Label class="font-semibold block text-sm leading-6 text-gray-900">
61-
{{ t('integrations.labels.apiKey') }}
62-
</Label>
63-
</FlexCell>
64-
<FlexCell>
65-
<TextInput
66-
class="w-96"
67-
v-model="channelInfo.apiKey"
68-
:placeholder="t('integrations.placeholders.apiKey')"
69-
/>
70-
</FlexCell>
71-
<FlexCell>
72-
<Label class="font-semibold block text-sm leading-6 text-gray-900">
73-
{{ t('integrations.labels.apiSecret') }}
74-
</Label>
75-
</FlexCell>
76-
<FlexCell>
77-
<TextInput
78-
class="w-96"
79-
v-model="channelInfo.apiSecret"
80-
:placeholder="t('integrations.placeholders.apiSecret')"
81-
:secret="true"
82-
/>
59+
<div class="w-96 rounded-xl border border-emerald-200 bg-emerald-50 px-4 py-3 text-sm leading-6 text-emerald-900">
60+
{{ t('integrations.create.wizard.step1.shopifyInfoModal.section.integrationStep8') }}
61+
</div>
8362
</FlexCell>
8463
<FlexCell>
8564
<Label class="font-semibold block text-sm leading-6 text-gray-900">
86-
{{ t('integrations.labels.accessToken') }}
65+
{{ t('integrations.labels.vendorProperty') }}
8766
</Label>
8867
</FlexCell>
89-
<FlexCell>
90-
<TextInput
91-
class="w-96"
92-
v-model="channelInfo.accessToken"
93-
:placeholder="t('integrations.placeholders.accessToken')"
94-
secret
95-
/>
96-
</FlexCell>
97-
9868
<FlexCell>
9969
<Flex between>
10070
<FlexCell grow>
101-
<Label class="font-semibold block text-sm leading-6 text-gray-900">
102-
{{ t('integrations.labels.vendorProperty') }}
103-
</Label>
71+
<div class="mt-1 text-sm leading-6 text-gray-400 w-96">
72+
<p>{{ t('integrations.salesChannel.helpText.shopifyVendorProperty') }}</p>
73+
</div>
74+
</FlexCell>
75+
<FlexCell center>
76+
<Button class="btn-primary px-1.5 py-1 rounded-full" @click="openInNewTab">
77+
<Icon name="plus"/>
78+
</Button>
10479
</FlexCell>
105-
<FlexCell center>
106-
<Button class="btn-primary px-1.5 py-1 rounded-full" @click="openInNewTab">
107-
<Icon name="plus"/>
108-
</Button>
109-
</FlexCell>
11080
</Flex>
111-
11281
</FlexCell>
11382
<FlexCell>
11483
<FieldQuery v-model="channelInfo.vendorProperty.id" :field="propertyField as QueryFormField" />
115-
116-
<div class="mt-1 text-sm leading-6 text-gray-400 w-96">
117-
<p>{{ t('integrations.salesChannel.helpText.shopifyVendorProperty') }}</p>
118-
</div>
11984
</FlexCell>
12085
</Flex>
12186
</FlexCell>

src/core/integrations/integrations/integrations-shopify-entry/ShopifyEntryController.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ const createShopifySalesChannel = async (queryParams: Record<string, any>, hostn
8181
const handleShopifySalesChannelSuccess = async (channelData: any) => {
8282
const id = channelData.id;
8383
84-
/*
8584
const { data } = await apolloClient.mutate({
8685
mutation: getShopifyRedirectUrlMutation,
8786
variables: { data: { id } },
@@ -90,15 +89,18 @@ const handleShopifySalesChannelSuccess = async (channelData: any) => {
9089
const result = data?.getShopifyRedirectUrl;
9190
9291
if (result?.redirectUrl) {
93-
window.location.href = result.redirectUrl;
92+
window.location.href = result.redirectUrl;
9493
return;
9594
}
9695
9796
const messages = result?.messages || [];
98-
messages.forEach((msg: any) => {
99-
Toast.error(msg.message);
100-
});
101-
*/
97+
if (messages.length) {
98+
messages.forEach((msg: any) => {
99+
Toast.error(msg.message);
100+
});
101+
} else {
102+
Toast.error(t('integrations.salesChannel.shopify.installed.genericError'));
103+
}
102104
103105
router.push({
104106
name: 'integrations.integrations.show',

src/core/integrations/integrations/integrations-show/containers/general/shopify-general-tab/ShopifyGeneralInfoTab.vue

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
updateShopifySalesChannelMutation
1717
} from "../../../../../../../shared/api/mutations/salesChannels.js";
1818
import { processGraphQLErrors } from "../../../../../../../shared/utils";
19-
import { cleanShopHostname } from "../../../../configs";
2019
import apolloClient from "../../../../../../../../apollo-client";
2120
import {FieldType, PropertyTypes} from "../../../../../../../shared/utils/constants";
2221
import {propertiesQuerySelector} from "../../../../../../../shared/api/queries/properties";
@@ -40,8 +39,6 @@ interface EditShopifyForm {
4039
importOrders: boolean;
4140
minNameLength: number | null;
4241
minDescriptionLength: number | null;
43-
apiKey: string;
44-
apiSecret: string;
4542
accessToken?: string;
4643
state?: string;
4744
gptEnable: boolean;
@@ -111,6 +108,7 @@ const cleanupAndMutate = async (mutate) => {
111108
const payload = { ...formData.value };
112109
113110
delete (payload as any).startingStock;
111+
delete (payload as any).accessToken;
114112
115113
if (!payload.vendorProperty?.id) {
116114
delete (payload as any).vendorProperty;
@@ -239,30 +237,6 @@ useShiftBackspaceKeyboardListener(goBack);
239237
</div>
240238
</div>
241239

242-
<div class="grid grid-cols-12 gap-4">
243-
<div class="md:col-span-6 col-span-12">
244-
<Label class="font-semibold block text-sm leading-6 text-gray-900 mb-1">
245-
{{ t('integrations.labels.apiKey') }}
246-
</Label>
247-
<TextInput v-model="formData.apiKey" disabled class="w-full" />
248-
</div>
249-
<div class="md:col-span-6 col-span-12">
250-
<Label class="font-semibold block text-sm leading-6 text-gray-900 mb-1">
251-
{{ t('integrations.labels.apiSecret') }}
252-
</Label>
253-
<TextInput v-model="formData.apiSecret" disabled :secret="true" class="w-full" />
254-
</div>
255-
</div>
256-
257-
<div class="grid grid-cols-12 gap-4">
258-
<div class="md:col-span-12 col-span-12">
259-
<Label class="font-semibold block text-sm leading-6 text-gray-900 mb-1">
260-
{{ t('integrations.labels.accessToken') }}
261-
</Label>
262-
<TextInput v-model="formData.accessToken" secret class="w-full" />
263-
</div>
264-
</div>
265-
266240
<!-- Accordion -->
267241
<Accordion class="mt-8" :items="accordionItems">
268242
<!-- Throttling -->

src/core/integrations/integrations/integrations.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@ export interface MagentoChannelInfo extends SpecificChannelInfo {
8989

9090
export interface ShopifyChannelInfo extends SpecificChannelInfo {
9191
vendorProperty: { id: string | null };
92-
apiKey: string;
93-
apiSecret: string;
94-
accessToken: string;
9592
hmac?: string;
9693
host?: string;
9794
timestamp?: string;
@@ -152,9 +149,6 @@ export function getMagentoDefaultFields(): MagentoChannelInfo {
152149
export function getShopifyDefaultFields(): ShopifyChannelInfo {
153150
return {
154151
vendorProperty: { id: null },
155-
apiKey: '',
156-
apiSecret: '',
157-
accessToken: '',
158152
};
159153
}
160154

src/core/integrations/routes.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,18 @@ export const routes = [
114114
meta: { title: 'integrations.show.miraklIssues.show.title' },
115115
component: () => import('./integrations/integrations-show/containers/issues/containers/MiraklProductIssueShowController.vue'),
116116
},
117-
// temporary commented since we no longer to oAuth
118-
// {
119-
// path: '/integrations/shopify/installed',
120-
// name: 'integrations.shopify.installed',
121-
// meta: { title: 'integrations.shopify.installed.title' },
122-
// component: () => import('./integrations/integrations-installed/shopify-installed/ShopifyInstalledController.vue'),
123-
// },
124-
// {
125-
// path: '/integrations/shopify/entry',
126-
// name: 'integrations.shopify.entry',
127-
// meta: { title: 'integrations.shopify.entry.title' },
128-
// component: () => import('./integrations/integrations-shopify-entry/ShopifyEntryController.vue'),
129-
// },
117+
{
118+
path: '/integrations/shopify/installed',
119+
name: 'integrations.shopify.installed',
120+
meta: { title: 'integrations.shopify.installed.title' },
121+
component: () => import('./integrations/integrations-installed/shopify-installed/ShopifyInstalledController.vue'),
122+
},
123+
{
124+
path: '/integrations/shopify/entry',
125+
name: 'integrations.shopify.entry',
126+
meta: { title: 'integrations.shopify.entry.title' },
127+
component: () => import('./integrations/integrations-shopify-entry/ShopifyEntryController.vue'),
128+
},
130129
{
131130
path: '/integrations/amazon/installed',
132131
name: 'integrations.amazon.installed',

src/locale/de.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,6 +1153,14 @@
11531153
"webhook": "Webhook",
11541154
"mirakl": ""
11551155
},
1156+
"shopify": {
1157+
"entry": {
1158+
"title": ""
1159+
},
1160+
"installed": {
1161+
"title": ""
1162+
}
1163+
},
11561164
"amazon": {
11571165
"actions": {
11581166
"bulkForceUpdate": {

src/locale/en.json

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4839,10 +4839,10 @@
48394839
"integrationStep5Part1": "Open the new app and go to 'Configuration'.",
48404840
"integrationStep5Part2": "Under 'Admin API integration' click 'Configure' and enable these scopes:",
48414841
"integrationStep5Part3": "Click 'Save'.",
4842-
"integrationStep6Part1": "In 'API credentials' select 'Install app' and confirm. ",
4843-
"integrationStep6Part2": "Now the API key, API secret key and Admin API access token are ready for the last step of this wizard.",
4842+
"integrationStep6Part1": "In 'Configuration', set your app URL and allowed redirection URL so OneSila can send the Shopify authorization response back to the correct callback page.",
4843+
"integrationStep6Part2": "Use the backend-provided Shopify callback URL for the allowed redirection URL. OAuth will issue the access token after authorization, so you no longer need to copy API credentials into this wizard.",
48444844
"integrationStep7": "From the Sales channels sidebar choose 'View your online store' and copy the URL from your browser and paste it in the step 2 of this wizard.",
4845-
"integrationStep8": "During step 4 of the wizard paste the API key, secret key and access token, then click Finish.",
4845+
"integrationStep8": "During step 4 of the wizard review the Shopify-specific settings and click Finish. OneSila will then redirect you to Shopify to authorize the connection.",
48464846
"appUrlLabel": "App URL",
48474847
"allowedRedirectUrlLabel": "Allowed redirection URL(s)",
48484848
"customAppTitle": "Create Custom App",
@@ -4868,7 +4868,7 @@
48684868
},
48694869
"shopify": {
48704870
"title": "Shopify Channel Details",
4871-
"content": "Provide Shopify-specific configuration to connect your store."
4871+
"content": "Review the Shopify-specific settings. When you finish, OneSila will redirect you to Shopify to authorize the connection."
48724872
},
48734873
"woocommerce": {
48744874
"title": "WooCommerce Channel Details",
@@ -5074,6 +5074,14 @@
50745074
"title": "Ebay Connected"
50755075
}
50765076
},
5077+
"shopify": {
5078+
"entry": {
5079+
"title": "Connect Shopify"
5080+
},
5081+
"installed": {
5082+
"title": "Shopify Connected"
5083+
}
5084+
},
50775085
"salesChannel": {
50785086
"shopify": {
50795087
"installed": {

src/locale/fr.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,6 +1150,14 @@
11501150
"webhook": "Webhook",
11511151
"mirakl": ""
11521152
},
1153+
"shopify": {
1154+
"entry": {
1155+
"title": ""
1156+
},
1157+
"installed": {
1158+
"title": ""
1159+
}
1160+
},
11531161
"amazon": {
11541162
"actions": {
11551163
"bulkForceUpdate": {

src/locale/nl.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3909,6 +3909,14 @@
39093909
"webhook": "Webhook",
39103910
"mirakl": ""
39113911
},
3912+
"shopify": {
3913+
"entry": {
3914+
"title": ""
3915+
},
3916+
"installed": {
3917+
"title": ""
3918+
}
3919+
},
39123920
"amazon": {
39133921
"actions": {
39143922
"bulkForceUpdate": {

0 commit comments

Comments
 (0)