@hotwax/dxp-components 1.3.2 → 1.3.4
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/lib/components/Login.js +1 -20
- package/lib/index.js +0 -1
- package/lib/store/auth.d.ts +1 -3
- package/lib/store/auth.js +0 -11
- package/package.json +1 -1
package/lib/components/Login.js
CHANGED
|
@@ -35,26 +35,7 @@ var _default = (0, _vue.defineComponent)({
|
|
|
35
35
|
oms,
|
|
36
36
|
expirationTime
|
|
37
37
|
} = this.route.query;
|
|
38
|
-
|
|
39
|
-
const appOms = this.authStore.oms;
|
|
40
|
-
const appExpirationTime = this.authStore.token.expiration;
|
|
41
|
-
|
|
42
|
-
// show alert if token/oms exist and are different from the app's
|
|
43
|
-
if (appToken && token && (appToken != token || appOms != oms)) {
|
|
44
|
-
// for backward compatibility
|
|
45
|
-
this.authStore.$patch({
|
|
46
|
-
token: {
|
|
47
|
-
value: appToken,
|
|
48
|
-
expiration: appExpirationTime
|
|
49
|
-
},
|
|
50
|
-
oms: appOms
|
|
51
|
-
});
|
|
52
|
-
_index.loginContext.confirmSessionEnd('dev-oms').then(isConfirmed => {
|
|
53
|
-
isConfirmed ? this.handleUserFlow(token, oms, expirationTime) : this.router.push('/');
|
|
54
|
-
});
|
|
55
|
-
} else {
|
|
56
|
-
this.handleUserFlow(token, oms, expirationTime);
|
|
57
|
-
}
|
|
38
|
+
this.handleUserFlow(token, oms, expirationTime);
|
|
58
39
|
},
|
|
59
40
|
methods: {
|
|
60
41
|
async handleUserFlow(token, oms, expirationTime) {
|
package/lib/index.js
CHANGED
|
@@ -66,7 +66,6 @@ let dxpComponents = {
|
|
|
66
66
|
app.component('Login', _Login.default);
|
|
67
67
|
app.component('ShopifyImg', _ShopifyImg.default);
|
|
68
68
|
loginContext.login = options.login;
|
|
69
|
-
loginContext.confirmSessionEnd = options.confirmSessionEnd;
|
|
70
69
|
loginContext.logout = options.logout;
|
|
71
70
|
loginContext.loader = options.loader;
|
|
72
71
|
loginContext.appLoginUrl = options.appLoginUrl;
|
package/lib/store/auth.d.ts
CHANGED
package/lib/store/auth.js
CHANGED
|
@@ -28,17 +28,6 @@ const useAuthStore = (0, _pinia.defineStore)('userAuth', {
|
|
|
28
28
|
return state.token.value && !isTokenExpired;
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
|
-
actions: {
|
|
32
|
-
// TODO will be done once backend support is there
|
|
33
|
-
async authenticate() {
|
|
34
|
-
// try {
|
|
35
|
-
// // authenticate through cookies
|
|
36
|
-
// return this.token
|
|
37
|
-
// } catch (error) {
|
|
38
|
-
// console.log(error)
|
|
39
|
-
// }
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
31
|
persist: true
|
|
43
32
|
});
|
|
44
33
|
exports.useAuthStore = useAuthStore;
|