@tapni/auth 0.0.8 → 0.0.10
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/dist/TapniAuth.es.js +64 -78
- package/dist/TapniAuth.umd.js +9 -9
- package/package.json +1 -1
- package/src/App.vue +2 -12
- package/src/main.js +5 -1
- package/src/mixins/auth.mixin.js +1 -6
- package/src/mixins/global.mixin.js +13 -0
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -88,11 +88,11 @@ import SSOPick from "@/components/SSOPick.vue";
|
|
|
88
88
|
import {EventBus} from "./store/event-bus.js";
|
|
89
89
|
import AuthMixin from "@/mixins/auth.mixin.js";
|
|
90
90
|
import Language from "@/components/Language.vue";
|
|
91
|
-
import {StorageService
|
|
91
|
+
import {StorageService} from '@tapni/capacitor-reactive-localstorage-vue3';
|
|
92
92
|
|
|
93
93
|
export default {
|
|
94
94
|
name: 'TapniAuth',
|
|
95
|
-
mixins: [AuthMixin
|
|
95
|
+
mixins: [AuthMixin],
|
|
96
96
|
data () {
|
|
97
97
|
return {
|
|
98
98
|
initialized: false
|
|
@@ -114,16 +114,6 @@ export default {
|
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
async mounted() {
|
|
117
|
-
await this.initializeStorage({
|
|
118
|
-
'realm': '',
|
|
119
|
-
'token': '',
|
|
120
|
-
'refreshTokens': '',
|
|
121
|
-
'username': '',
|
|
122
|
-
'UserId': '',
|
|
123
|
-
'verifyEmail': '',
|
|
124
|
-
'subdomain': ''
|
|
125
|
-
});
|
|
126
|
-
|
|
127
117
|
this.applyBgStyle()
|
|
128
118
|
|
|
129
119
|
EventBus.$on('ssoEvent', this.ssoOutgoingEvent)
|
package/src/main.js
CHANGED
|
@@ -5,6 +5,7 @@ import { createApp } from 'vue'
|
|
|
5
5
|
import RootApp from './App.vue'
|
|
6
6
|
import router from './router'
|
|
7
7
|
import GlobalMixin from './mixins/global.mixin'
|
|
8
|
+
// import {StorageMixin} from "@tapni/capacitor-reactive-localstorage-vue3";
|
|
8
9
|
import VueCookies from 'vue-cookies'
|
|
9
10
|
import { App } from '@capacitor/app';
|
|
10
11
|
import { Browser } from '@capacitor/browser';
|
|
@@ -17,7 +18,10 @@ app.config.productionTip = false
|
|
|
17
18
|
app.use(VueCookies)
|
|
18
19
|
|
|
19
20
|
// Global Mixin
|
|
20
|
-
app.mixin(GlobalMixin)
|
|
21
|
+
app.mixin(GlobalMixin);
|
|
22
|
+
|
|
23
|
+
// Reactive Storage
|
|
24
|
+
// app.mixin(StorageMixin);
|
|
21
25
|
|
|
22
26
|
app.use(router)
|
|
23
27
|
|
package/src/mixins/auth.mixin.js
CHANGED
|
@@ -489,6 +489,7 @@ export default {
|
|
|
489
489
|
EventBus.$emit("ssoEvent", { name: "setRefreshToken", data: token });
|
|
490
490
|
},
|
|
491
491
|
setToken(token) {
|
|
492
|
+
console.log('setup token')
|
|
492
493
|
this.storage.token = token;
|
|
493
494
|
this.token = token;
|
|
494
495
|
EventBus.$emit("ssoEvent", { name: "setToken", data: token });
|
|
@@ -515,11 +516,5 @@ export default {
|
|
|
515
516
|
},
|
|
516
517
|
deep: true,
|
|
517
518
|
},
|
|
518
|
-
storage: {
|
|
519
|
-
async handler() {
|
|
520
|
-
await store.setRaw(this.storage);
|
|
521
|
-
},
|
|
522
|
-
deep: true
|
|
523
|
-
}
|
|
524
519
|
},
|
|
525
520
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import {Capacitor} from '@capacitor/core';
|
|
2
|
+
import {StorageMixin} from "@tapni/capacitor-reactive-localstorage-vue3";
|
|
2
3
|
|
|
3
4
|
export default {
|
|
5
|
+
mixins: [StorageMixin],
|
|
4
6
|
computed: {
|
|
5
7
|
home() {
|
|
6
8
|
if (this.storage.token && this.storage.username) {
|
|
@@ -28,6 +30,17 @@ export default {
|
|
|
28
30
|
return Capacitor.isNativePlatform()
|
|
29
31
|
},
|
|
30
32
|
},
|
|
33
|
+
async created () {
|
|
34
|
+
await this.initializeStorage({
|
|
35
|
+
'realm': '',
|
|
36
|
+
'token': '',
|
|
37
|
+
'refreshTokens': '',
|
|
38
|
+
'username': '',
|
|
39
|
+
'UserId': '',
|
|
40
|
+
'verifyEmail': '',
|
|
41
|
+
'subdomain': ''
|
|
42
|
+
});
|
|
43
|
+
},
|
|
31
44
|
methods: {
|
|
32
45
|
errorHandler(error) {
|
|
33
46
|
if (error && error.response && error.response.data && error.response.data.error) {
|