@tapni/auth 1.0.66 → 1.0.68

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": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
@@ -65,4 +65,4 @@
65
65
  "vite": "^5.4.11",
66
66
  "vite-plugin-node-polyfills": "^0.22.0"
67
67
  }
68
- }
68
+ }
package/src/App.vue CHANGED
@@ -57,11 +57,9 @@ import AuthCallback from '@/views/Callback.vue';
57
57
  import { EventBus } from './store/event-bus.js';
58
58
  import AuthMixin from '@/mixins/auth.mixin.js';
59
59
  import ReactiveStorage from '@tapni/capacitor-reactive-localstorage-vue3';
60
- import store from './store/auth.js';
61
60
  import UtilService from './services/UtilService.js';
62
61
 
63
62
  export default {
64
- store,
65
63
  name: 'TapniAuth',
66
64
  mixins: [ReactiveStorage, AuthMixin],
67
65
  data() {
@@ -145,9 +143,17 @@ export default {
145
143
  UtilService.compareLangKeys();
146
144
  }
147
145
 
148
- if (this.isNative) {
149
- this.$store.auth.state.allowedOriginsAuth.push('capacitor://localhost');
150
- }
146
+ if (this.isNative) {
147
+ this.$nextTick(() => {
148
+ try {
149
+ if (this.$store && this.$store.state && this.$store.state.auth) {
150
+ this.$store.commit('auth/addAllowedOrigin', 'capacitor://localhost');
151
+ }
152
+ } catch (error) {
153
+ console.error('Failed to add capacitor origin to allowed origins:', error);
154
+ }
155
+ });
156
+ }
151
157
  },
152
158
  methods: {
153
159
  checkAndClearStorage() {
package/src/store/auth.js CHANGED
@@ -107,6 +107,11 @@ export default {
107
107
  },
108
108
  setApiRoot(state, apiRoot) {
109
109
  state.apiRoot = apiRoot;
110
+ },
111
+ addAllowedOrigin(state, origin) {
112
+ if (!state.allowedOriginsAuth.includes(origin)) {
113
+ state.allowedOriginsAuth.push(origin);
114
+ }
110
115
  }
111
116
  },
112
117
  actions: {