@tapni/auth 0.0.23 → 0.0.24

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.23",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
@@ -34,7 +34,7 @@
34
34
  "@capacitor/preferences": "^5.0.6",
35
35
  "@codetrix-studio/capacitor-google-auth": "^3.3.6",
36
36
  "@recognizebv/capacitor-plugin-msauth": "^3.5.1",
37
- "@tapni/capacitor-reactive-localstorage-vue3": "^0.0.11",
37
+ "@tapni/capacitor-reactive-localstorage-vue3": "^0.0.13",
38
38
  "await-to-js": "^3.0.0",
39
39
  "axios": "^1.6.5",
40
40
  "jwt-decode": "^4.0.0",
package/src/install.js CHANGED
@@ -1,9 +1,14 @@
1
1
  import App from "./App.vue";
2
+ import ReactiveStorage from '@tapni/capacitor-reactive-localstorage-vue3'
2
3
 
3
4
  // Export the component by default
4
5
  export default {
5
6
  TapniAuth: App,
6
7
  install: (app, options) => {
7
8
  app.component('TapniAuth', App)
9
+
10
+ if (app.config.globalProperties.$storage === undefined) {
11
+ app.use(ReactiveStorage, options);
12
+ }
8
13
  }
9
14
  };
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 VueCookies from 'vue-cookies'
8
+ import ReactiveStorage from '@tapni/capacitor-reactive-localstorage-vue3'
8
9
  import { App } from '@capacitor/app';
9
10
  import { Browser } from '@capacitor/browser';
10
11
 
@@ -12,6 +13,15 @@ const app = createApp(RootApp)
12
13
 
13
14
  app.config.productionTip = false
14
15
 
16
+ app.use(ReactiveStorage, {
17
+ 'token': '',
18
+ 'refreshTokens': '',
19
+ 'username': '',
20
+ 'UserId': '',
21
+ 'verifyEmail': '',
22
+ 'subdomain': ''
23
+ });
24
+
15
25
  // Cookies
16
26
  app.use(VueCookies)
17
27
 
@@ -17,10 +17,9 @@ import sr from "../store/locales/sr.js";
17
17
  import tr from "../store/locales/tr.js";
18
18
  import cn from "../store/locales/cn.js";
19
19
  import kr from "../store/locales/kr.js";
20
- import { StorageMixin } from '@tapni/capacitor-reactive-localstorage-vue3'
21
20
  import GlobalMixin from './global.mixin'
22
21
  export default {
23
- mixins: [StorageMixin, GlobalMixin],
22
+ mixins: [GlobalMixin],
24
23
  data() {
25
24
  return {
26
25
  appLanguage: "en",
@@ -1,8 +1,6 @@
1
1
  import {Capacitor} from '@capacitor/core';
2
- import {StorageMixin} from "@tapni/capacitor-reactive-localstorage-vue3";
3
2
 
4
3
  export default {
5
- mixins: [StorageMixin],
6
4
  computed: {
7
5
  home() {
8
6
  if (this.storage.token && this.storage.username) {
@@ -30,17 +28,6 @@ export default {
30
28
  return Capacitor.isNativePlatform()
31
29
  },
32
30
  },
33
- async mounted () {
34
- await this.initializeStorage({
35
- 'realm': '',
36
- 'token': '',
37
- 'refreshTokens': '',
38
- 'username': '',
39
- 'UserId': '',
40
- 'verifyEmail': '',
41
- 'subdomain': ''
42
- });
43
- },
44
31
  methods: {
45
32
  errorHandler(error) {
46
33
  if (error && error.response && error.response.data && error.response.data.error) {
@@ -372,13 +372,13 @@ export default {
372
372
  EventBus.$emit('ssoEvent', {name: 'toggleAddAccountModalRegister', data: {}})
373
373
  },
374
374
  async bum () {
375
- this.storage.token = '321213';
375
+ this.$storage.token = '321213';
376
376
  }
377
377
  },
378
378
  watch: {
379
379
  emailOrUsername(nv) {
380
380
  if (nv.includes("@")) {
381
- this.storage.verifyEmail = nv;
381
+ this.$storage.verifyEmail = nv;
382
382
  }
383
383
  },
384
384
  '$route.path': async function(routePath) {