@tapni/auth 0.0.33 → 0.0.35

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.33",
3
+ "version": "0.0.35",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
package/src/App.vue CHANGED
@@ -122,13 +122,15 @@ export default {
122
122
  },
123
123
  methods: {
124
124
  async init () {
125
- if (this.$storage && this.$storage.token && this.$storage.refreshTokens) {
126
- this.setToken(this.$storage.token);
127
- const refreshTokens = this.getRefreshTokens();
128
- this.setRefreshToken(refreshTokens[0]);
129
- this.getLoggedInAccounts();
130
- }
125
+
126
+ // Make sure the function is called just once
127
+ if (this.initialized) return;
131
128
  this.initialized = true;
129
+
130
+ this.setToken(this.$storage.token);
131
+ const refreshTokens = this.getRefreshTokens();
132
+ this.setRefreshToken(refreshTokens[0]);
133
+ this.getLoggedInAccounts();
132
134
  this.$emit('ssoLibraryReady');
133
135
  },
134
136
  ssoOutgoingEvent (data) {
@@ -151,7 +153,7 @@ export default {
151
153
  watch: {
152
154
  display () {
153
155
  this.applyBgStyle()
154
- }
156
+ },
155
157
  }
156
158
  }
157
159
  </script>
package/src/install.js CHANGED
@@ -4,9 +4,7 @@ import ReactiveStorage from '@tapni/capacitor-reactive-localstorage-vue3'
4
4
  // Export the component by default
5
5
  export default {
6
6
  TapniAuth: App,
7
- install: (app, options) => {
7
+ install: (app) => {
8
8
  app.component('TapniAuth', App);
9
-
10
- + app.use(ReactiveStorage, options);
11
9
  }
12
10
  };
@@ -300,14 +300,14 @@ export default {
300
300
  computed: {
301
301
  displayFormLogin() {
302
302
  return (
303
- (this.company?.login?.form_login && !this.isModal) ?? this.emailLogin
303
+ (this.ssoCompany?.login?.form_login && !this.isModal) ?? this.emailLogin
304
304
  );
305
305
  },
306
306
  displayResetPasswordLogin() {
307
- return (this.company?.login?.reset_password && !this.isModal) ?? true;
307
+ return (this.ssoCompany?.login?.reset_password && !this.isModal) ?? true;
308
308
  },
309
309
  displayRegisterLogin() {
310
- return (this.company?.login?.create_account && !this.isModal) ?? true;
310
+ return (this.ssoCompany?.login?.create_account && !this.isModal) ?? true;
311
311
  },
312
312
  },
313
313
  async mounted() {