@tapni/auth 0.0.9 → 0.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapni/auth",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
package/src/App.vue CHANGED
@@ -88,11 +88,10 @@ 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, StorageMixin} from '@tapni/capacitor-reactive-localstorage-vue3';
92
91
 
93
92
  export default {
94
93
  name: 'TapniAuth',
95
- mixins: [AuthMixin, StorageMixin],
94
+ mixins: [AuthMixin],
96
95
  data () {
97
96
  return {
98
97
  initialized: false
@@ -114,16 +113,6 @@ export default {
114
113
  }
115
114
  },
116
115
  async mounted() {
117
- await this.initializeStorage({
118
- 'realm': '',
119
- 'token': '',
120
- 'refreshTokens': '',
121
- 'username': '',
122
- 'UserId': '',
123
- 'verifyEmail': '',
124
- 'subdomain': ''
125
- });
126
-
127
116
  this.applyBgStyle()
128
117
 
129
118
  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
 
@@ -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 });
@@ -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) {
@@ -347,7 +347,7 @@ export default {
347
347
  isModal: this.isModal,
348
348
  captcha: this.captcha,
349
349
  password: this.password,
350
- captchaToken: await this.getCaptchaToken('account_verify')
350
+ // captchaToken: await this.getCaptchaToken('account_verify')
351
351
  };
352
352
  if (this.emailOrUsername.indexOf("@") !== -1) {
353
353
  loginData.email = this.emailOrUsername;