@lilaquadrat/design-core 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +76 -3
- package/html/index.server.html +1 -8
- package/package.json +54 -54
- package/src/client-entry.ts +8 -8
- package/src/components/partials/error.partial.vue +19 -19
- package/src/components/partials/main-components.partial.vue +75 -70
- package/src/components/partials/qrcode.partial.vue +8 -8
- package/src/functions/AuthProviderFactory.ts +30 -0
- package/src/functions/PaymenyProviderFactory.ts +11 -11
- package/src/functions/auth0.provider.ts +75 -0
- package/src/functions/keycloak.provider.ts +228 -0
- package/src/functions/lila-dom.ts +50 -50
- package/src/functions/shopify.provider.ts +176 -154
- package/src/functions/stripe.provider.ts +120 -108
- package/src/globals.d.ts +1 -2
- package/src/index.ts +9 -7
- package/src/interfaces/AuthCallbackResult.interface.ts +5 -0
- package/src/interfaces/AuthConfig.interface.ts +13 -0
- package/src/interfaces/AuthProvider.interface.ts +15 -0
- package/src/interfaces/FrontendConfig.interface.ts +11 -40
- package/src/interfaces/GenericEvents.interface.ts +1 -1
- package/src/interfaces/IdTokenExtended.interface.ts +13 -4
- package/src/interfaces/PaymentProvider.interface.ts +2 -2
- package/src/interfaces/RenderOptions.interface.ts +12 -0
- package/src/libs/ActionNotice.ts +125 -125
- package/src/libs/Models.class.ts +219 -221
- package/src/main.ts +41 -36
- package/src/mixins/createCookieString.ts +50 -36
- package/src/mixins/createModelDeclaration.ts +22 -19
- package/src/mixins/createRouter.ts +12 -12
- package/src/mixins/date.ts +4 -2
- package/src/mixins/formatSize.ts +5 -5
- package/src/mixins/getAnchor.ts +1 -1
- package/src/mixins/getRoutes.ts +13 -25
- package/src/mixins/hasSlotContent.ts +22 -16
- package/src/mixins/hooks.ts +101 -60
- package/src/mixins/loadComponents.ts +60 -58
- package/src/mixins/logger.ts +17 -13
- package/src/mixins/replaceVariables.ts +10 -8
- package/src/mixins/scroll.ts +61 -45
- package/src/models/Address.model.ts +7 -7
- package/src/models/Contact.model.ts +14 -14
- package/src/plugins/analytics.ts +198 -0
- package/src/plugins/auth.ts +74 -60
- package/src/plugins/currency.ts +10 -10
- package/src/plugins/events.ts +101 -97
- package/src/plugins/filters.ts +21 -18
- package/src/plugins/replacer.ts +7 -6
- package/src/plugins/signupFlow.ts +45 -43
- package/src/plugins/traceable.ts +28 -26
- package/src/plugins/translations.ts +9 -9
- package/src/plugins/youtube.ts +39 -34
- package/src/routes.ts +108 -108
- package/src/server-entry.ts +75 -77
- package/src/stores/calls.store.ts +14 -14
- package/src/stores/cart.store.ts +116 -107
- package/src/stores/content.store.ts +87 -45
- package/src/stores/editor.store.ts +16 -16
- package/src/stores/files.store.ts +72 -72
- package/src/stores/main.store.ts +155 -109
- package/src/stores/user.store.ts +72 -68
- package/src/translations/de.ts +127 -127
- package/src/views/content.view.vue +81 -143
- package/src/views/download.view.vue +25 -23
- package/src/views/editor.view.vue +150 -125
- package/src/views/login.view.vue +35 -36
- package/src/views/signup-account.view.vue +14 -14
- package/tooling/cypress/config.ts +68 -54
- package/tooling/cypress/manifest-utils.mjs +34 -22
- package/tooling/cypress/run-parallel.mjs +41 -35
- package/tooling/cypress/support/commands.ts +458 -300
- package/tooling/eslint.config.js +1 -223
- package/tooling/preview.plugin.js +132 -0
- package/tooling/ssr-test/index.mjs +205 -203
- package/tooling/vite.d.ts +36 -0
- package/tooling/vite.js +234 -0
- package/src/interfaces/EditorConfiguration.interface.ts +0 -15
- package/tooling/preview.plugin.ts +0 -134
- package/tooling/stylelint.config.mjs +0 -24
- package/tooling/vite.ts +0 -260
|
@@ -21,51 +21,53 @@ const isImage = computed(() => imageExtensions.has(extension.value ?? ''));
|
|
|
21
21
|
const isVideo = computed(() => videoExtensions.has(extension.value ?? ''));
|
|
22
22
|
const downloadUrl = computed(() => {
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const { company, project } = mainStore;
|
|
25
|
+
const { secure } = mainStore.endpoints ?? {};
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
if (!secure || !company) return undefined;
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
const parts = [secure, app.value, company];
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
if (app.value !== 'customers' && project) {
|
|
32
|
+
|
|
33
|
+
parts.push(project);
|
|
34
|
+
if (list.value) parts.push(list.value);
|
|
35
|
+
|
|
36
|
+
}
|
|
35
37
|
|
|
36
|
-
|
|
38
|
+
parts.push(filename.value);
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
const queryParams = new URLSearchParams();
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
if (customer.value) queryParams.set('customer', customer.value);
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
const token = filesStore.token?.token;
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
if (token) queryParams.set('token', token);
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
const queryString = queryParams.toString();
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
return parts.join('/') + (queryString ? `?${queryString}` : '');
|
|
49
51
|
|
|
50
52
|
});
|
|
51
53
|
|
|
52
54
|
onMounted(async () => {
|
|
53
55
|
|
|
54
|
-
|
|
56
|
+
if (!filesStore.isTokenValid(app.value, scope.value)) {
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
try {
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
await filesStore.fetchToken(app.value, scope.value);
|
|
59
61
|
|
|
60
|
-
|
|
62
|
+
} catch (e) {
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
error.value = (e as Error)?.message || 'TOKEN_FETCH_FAILED';
|
|
63
65
|
|
|
64
|
-
|
|
66
|
+
}
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
}
|
|
67
69
|
|
|
68
|
-
|
|
70
|
+
loading.value = false;
|
|
69
71
|
|
|
70
72
|
});
|
|
71
73
|
|
|
@@ -25,214 +25,239 @@ const settingsCache = ref<AppEditorConfiguration>();
|
|
|
25
25
|
const active = ref<EditorActiveModule>();
|
|
26
26
|
const mainStore = useMainStore();
|
|
27
27
|
const init = ref<boolean>(false);
|
|
28
|
+
const target = ref<'browser'|'mail'>('browser');
|
|
28
29
|
|
|
29
30
|
watch(siteSettings, () => {
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
/**
|
|
32
33
|
* if the target type changes we need to update the available modules
|
|
33
34
|
*/
|
|
34
|
-
|
|
35
|
+
const useTarget = siteSettings.value?.target || 'browser';
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
if(useTarget !== target.value) {
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
const moduleTarget = siteSettings.value?.target === 'browser' || !siteSettings.value?.target
|
|
40
|
+
? 'browser'
|
|
41
|
+
: siteSettings.value?.target
|
|
41
42
|
|
|
42
|
-
|
|
43
|
+
target.value = useTarget;
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
postModules();
|
|
46
|
+
postCustomModules();
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
if (currentInstance) {
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
loadViaDeclarationSync(moduleTarget === 'browser' ? editorStore.modulesBrowser : editorStore.modulesMail, 'lila', 'module', currentInstance.appContext.app);
|
|
51
|
+
loadViaDeclarationSync(moduleTarget === 'browser' ? editorStore.partialsBrowser : editorStore.partialsMail, 'lila', 'partial', currentInstance.appContext.app);
|
|
51
52
|
|
|
52
|
-
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
}
|
|
55
56
|
|
|
56
57
|
})
|
|
57
58
|
|
|
58
|
-
function messageHandler
|
|
59
|
+
function messageHandler(message: StudioIframeMessage) {
|
|
59
60
|
|
|
60
|
-
|
|
61
|
-
console.groupCollapsed('MESSAGE_STUDIO_CONTENT');
|
|
62
|
-
console.debug(message.data.data);
|
|
63
|
-
console.groupEnd();
|
|
61
|
+
if (message.data.type === 'studio-content') {
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
console.groupCollapsed('MESSAGE_STUDIO_CONTENT');
|
|
64
|
+
console.debug(message.data.data);
|
|
65
|
+
console.groupEnd();
|
|
66
|
+
|
|
67
|
+
contentCache.value = message.data.data;
|
|
68
|
+
updateContent();
|
|
69
|
+
|
|
70
|
+
}
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
console.groupCollapsed('MESSAGE_STUDIO_SETTINGS');
|
|
72
|
-
console.debug(message.data.data);
|
|
73
|
-
console.groupEnd();
|
|
72
|
+
//editor main configuration
|
|
73
|
+
if (message.data.type === 'studio-settings') {
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
75
|
+
console.groupCollapsed('MESSAGE_STUDIO_SETTINGS');
|
|
76
|
+
console.debug(message.data.data);
|
|
77
|
+
console.groupEnd();
|
|
79
78
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
settingsCache.value = message.data.data;
|
|
80
|
+
mainStore.editor = message.data.data;
|
|
81
|
+
updateContent();
|
|
82
|
+
|
|
83
|
+
}
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
if (message.data.type === 'studio-editor-settings') {
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
console.groupCollapsed('MESSAGE_STUDIO_EDITOR_SETTINGS');
|
|
88
|
+
console.debug(message.data.data);
|
|
89
|
+
console.groupEnd();
|
|
88
90
|
|
|
89
|
-
|
|
90
|
-
postCustomModules();
|
|
91
|
-
postEvents();
|
|
92
|
-
init.value = true;
|
|
91
|
+
siteSettings.value = message.data.data;
|
|
93
92
|
|
|
94
|
-
|
|
93
|
+
if(!init.value) {
|
|
95
94
|
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
postModules();
|
|
96
|
+
postCustomModules();
|
|
97
|
+
postEvents();
|
|
98
|
+
init.value = true;
|
|
98
99
|
|
|
99
|
-
|
|
100
|
+
}
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
console.debug(message.data.data);
|
|
104
|
-
console.groupEnd();
|
|
102
|
+
updateContent();
|
|
103
|
+
updateContext();
|
|
105
104
|
|
|
106
|
-
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (message.data.type === 'studio-active') {
|
|
108
|
+
|
|
109
|
+
console.groupCollapsed('MESSAGE_STUDIO_ACTIVE');
|
|
110
|
+
console.debug(message.data.data);
|
|
111
|
+
console.groupEnd();
|
|
112
|
+
|
|
113
|
+
active.value = message.data.data;
|
|
107
114
|
|
|
108
|
-
|
|
115
|
+
if (active.value) {
|
|
109
116
|
|
|
110
|
-
|
|
117
|
+
scrollToModule(active.value);
|
|
111
118
|
|
|
119
|
+
}
|
|
120
|
+
|
|
112
121
|
}
|
|
113
|
-
}
|
|
114
122
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
if (message.data.type === 'studio-cookie-reset') {
|
|
124
|
+
|
|
125
|
+
console.groupCollapsed('MESSAGE_STUDIO_COOKIE_RESET');
|
|
126
|
+
console.debug(message.data.data);
|
|
127
|
+
console.groupEnd();
|
|
128
|
+
|
|
129
|
+
resetCookies();
|
|
130
|
+
|
|
131
|
+
}
|
|
119
132
|
|
|
120
|
-
resetCookies();
|
|
121
|
-
}
|
|
122
133
|
}
|
|
123
134
|
|
|
124
135
|
onMounted(() => {
|
|
125
136
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
137
|
+
if (window.origin === 'null') {
|
|
138
|
+
|
|
139
|
+
live.value = true;
|
|
140
|
+
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (live.value) return;
|
|
129
144
|
|
|
130
|
-
|
|
145
|
+
removeListeners()
|
|
146
|
+
addListeners();
|
|
131
147
|
|
|
132
|
-
|
|
133
|
-
|
|
148
|
+
window.parent.postMessage('studio-design-settings', '*');
|
|
149
|
+
window.parent.postMessage('studio-design-ready', '*');
|
|
134
150
|
|
|
135
|
-
window.parent.postMessage('studio-design-settings', '*');
|
|
136
|
-
window.parent.postMessage('studio-design-ready', '*');
|
|
137
151
|
});
|
|
138
152
|
|
|
139
153
|
onBeforeUnmount(() => removeListeners());
|
|
140
154
|
|
|
141
|
-
function removeListeners
|
|
142
|
-
|
|
155
|
+
function removeListeners() {
|
|
156
|
+
|
|
157
|
+
window.removeEventListener('message', messageHandler, false);
|
|
158
|
+
|
|
143
159
|
}
|
|
144
160
|
|
|
145
|
-
function addListeners
|
|
146
|
-
|
|
161
|
+
function addListeners() {
|
|
162
|
+
|
|
163
|
+
window.addEventListener('message', messageHandler, false);
|
|
164
|
+
|
|
147
165
|
}
|
|
148
166
|
|
|
149
|
-
function updateContent
|
|
150
|
-
|
|
167
|
+
function updateContent() {
|
|
168
|
+
|
|
169
|
+
content.value = prepareContent({ modules: contentCache.value, ...siteSettings.value });
|
|
170
|
+
|
|
151
171
|
}
|
|
152
172
|
|
|
153
|
-
function postModules
|
|
173
|
+
function postModules() {
|
|
154
174
|
|
|
155
|
-
|
|
175
|
+
console.log('POST MODULES', target.value);
|
|
156
176
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
177
|
+
const modules = target.value === 'browser'
|
|
178
|
+
? editorStore.availableModulesWithRevision
|
|
179
|
+
: editorStore.availableModulesWithRevisionMail
|
|
160
180
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
181
|
+
window.parent.postMessage(
|
|
182
|
+
{
|
|
183
|
+
type: 'studio-design-modules-with-revision',
|
|
184
|
+
data: hardCopy(modules),
|
|
185
|
+
},
|
|
186
|
+
'*',
|
|
187
|
+
);
|
|
168
188
|
|
|
169
189
|
}
|
|
170
190
|
|
|
171
|
-
function postCustomModules
|
|
191
|
+
function postCustomModules() {
|
|
172
192
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
193
|
+
const modules = target.value === 'browser'
|
|
194
|
+
? mainStore.customModulesBrowser
|
|
195
|
+
: mainStore.customModulesMail
|
|
176
196
|
|
|
177
|
-
|
|
197
|
+
if (!modules) return;
|
|
178
198
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
199
|
+
window.parent.postMessage(
|
|
200
|
+
{
|
|
201
|
+
type: 'studio-design-custom-modules',
|
|
202
|
+
data: hardCopy(modules),
|
|
203
|
+
},
|
|
204
|
+
'*',
|
|
205
|
+
);
|
|
186
206
|
|
|
187
207
|
}
|
|
188
208
|
|
|
189
|
-
function postEvents
|
|
209
|
+
function postEvents() {
|
|
190
210
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
211
|
+
window.parent.postMessage(
|
|
212
|
+
{
|
|
213
|
+
type: 'studio-design-events',
|
|
214
|
+
data: eventDeclarations,
|
|
215
|
+
},
|
|
216
|
+
'*',
|
|
217
|
+
);
|
|
198
218
|
|
|
199
219
|
}
|
|
200
220
|
|
|
201
221
|
/**
|
|
202
222
|
* sets sitetitle and description
|
|
203
223
|
*/
|
|
204
|
-
function updateContext
|
|
224
|
+
function updateContext() {
|
|
205
225
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
226
|
+
contentStore.setContext({
|
|
227
|
+
sitetitle: siteSettings?.value?.settings?.title,
|
|
228
|
+
description: siteSettings?.value?.settings?.description,
|
|
229
|
+
})
|
|
210
230
|
|
|
211
231
|
}
|
|
212
232
|
|
|
213
|
-
function resetCookies
|
|
214
|
-
|
|
233
|
+
function resetCookies() {
|
|
234
|
+
|
|
235
|
+
const cookies = document.cookie.split(';').filter((single) => single);
|
|
215
236
|
|
|
216
|
-
|
|
217
|
-
|
|
237
|
+
cookies.forEach((single) => {
|
|
238
|
+
|
|
239
|
+
const name = single.split('=');
|
|
240
|
+
|
|
241
|
+
document.cookie = `${name[0].trim()}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=None;`;
|
|
242
|
+
|
|
243
|
+
});
|
|
218
244
|
|
|
219
|
-
document.cookie = `${name[0].trim()}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; SameSite=None;`;
|
|
220
|
-
});
|
|
221
245
|
}
|
|
222
246
|
|
|
223
|
-
function scrollToModule
|
|
247
|
+
function scrollToModule(active: EditorActiveModule): void {
|
|
248
|
+
|
|
249
|
+
nextTick().then(() => {
|
|
224
250
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
const index = contentPosition?.findIndex((single) => single.uuid === active.uuid);
|
|
251
|
+
const baseModule = contentCache.value?.find((single) => single.uuid === active.uuid);
|
|
252
|
+
const containerSelector = baseModule?.position === 'content' || !baseModule?.position ? '.lila-content-module .container:not(.top, .bottom)' : `.lila-content-module .container.${baseModule.position}`;
|
|
253
|
+
const contentPosition: Content['modules'] = baseModule?.position === 'content' || !baseModule?.position ? content.value.content : content.value[baseModule.position];
|
|
254
|
+
const index = contentPosition?.findIndex((single) => single.uuid === active.uuid);
|
|
230
255
|
|
|
231
|
-
|
|
256
|
+
if (!index && index !== 0) return;
|
|
232
257
|
|
|
233
|
-
|
|
258
|
+
scrollToSelector(`${containerSelector} .lila-module:nth-child(${index + 1}), ${containerSelector} .partial-container:nth-child(${index + 1})`,)
|
|
234
259
|
|
|
235
|
-
|
|
260
|
+
});
|
|
236
261
|
|
|
237
262
|
}
|
|
238
263
|
</script>
|
package/src/views/login.view.vue
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type
|
|
2
|
+
import type AuthCallbackResult from '../interfaces/AuthCallbackResult.interface';
|
|
3
3
|
import { auth } from '../plugins/auth';
|
|
4
4
|
import useMainStore from '../stores/main.store';
|
|
5
5
|
import useUserStore from '../stores/user.store';
|
|
6
|
-
import type { RedirectLoginResult } from '@auth0/auth0-spa-js';
|
|
7
6
|
import StudioSDK from '@lilaquadrat/sdk';
|
|
8
7
|
import { onBeforeMount, ref } from 'vue';
|
|
9
8
|
import { useRouter } from 'vue-router';
|
|
@@ -17,66 +16,66 @@ const hint = ref<string>();
|
|
|
17
16
|
|
|
18
17
|
onBeforeMount(async () => {
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
let loginResult: AuthCallbackResult;
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// Attempt to handle the authentication callback.
|
|
22
|
+
try {
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
loginResult = await auth.handleCallback();
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
} catch (e: unknown) {
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
console.error(e);
|
|
29
|
+
error.value = true;
|
|
30
|
+
return;
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
}
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
await userStore.updateLock();
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
console.log(userStore.locked, loginResult);
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
const sdk = new StudioSDK(mainStore.apiConfig);
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
if(userStore.locked === 'user-connect' && loginResult?.appState?.customerId) {
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
try {
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
// Attempt to connect the user with the provided customerId.
|
|
45
|
+
await sdk.members.me.connect(loginResult?.appState?.customerId);
|
|
46
|
+
await userStore.updateLock();
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
} catch (e) {
|
|
50
49
|
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
console.error(e);
|
|
51
|
+
console.error('CONNECT_ACCOUNT_TO_CUSTOMER_FAILED');
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
}
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
}
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
if(!userStore.userData?.emailConfirmed && loginResult?.appState?.emailConfirmationCode) {
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
try {
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
// Attempt to confirm the email address with the provided code
|
|
62
|
+
await sdk.members.me.confirmEmail(loginResult?.appState?.emailConfirmationCode)
|
|
63
|
+
await userStore.updateLock();
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
} catch (e) {
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
console.error(e);
|
|
68
|
+
console.error('EMAIL_CONFIRMATION_FAILED');
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
}
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
}
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
router.replace(routeForLock(userStore.locked));
|
|
76
75
|
|
|
77
76
|
})
|
|
78
77
|
|
|
79
78
|
</script>
|
|
80
79
|
<template>
|
|
81
80
|
<lila-error-partial v-if="error" :status="400" :hint="hint" type="members" />
|
|
82
|
-
</template>
|
|
81
|
+
</template>
|
|
@@ -14,36 +14,36 @@ const store = useMainStore();
|
|
|
14
14
|
|
|
15
15
|
onBeforeMount(() => {
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
if(route.query.customerId) {
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
userStore.setCustomer({ _id: route.query.customerId as string });
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
if(route.query.emailConfirmationCode) {
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
userStore.emailConfirmationCode = route.query.emailConfirmationCode as string;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
if(!auth.isAuth.value) {
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
auth.triggerSignup(userStore.customer?._id, userStore.emailConfirmationCode);
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
} else {
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
router.push({ name: 'members' });
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
const contentMerged = computed(() => {
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
const data = store.staticData?.redirect;
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
if(data) return prepareContent(data) as unknown as ContentWithPositions;
|
|
46
|
+
return prepareContent({}) as unknown as ContentWithPositions;
|
|
47
47
|
|
|
48
48
|
});
|
|
49
49
|
|