@tapni/auth 0.0.162 → 0.0.164

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.
@@ -1195,7 +1195,7 @@ Li(q);
1195
1195
  const aa = {
1196
1196
  computed: {
1197
1197
  home() {
1198
- return this.$storex && this.$storex.token && this.$storex.username ? "/" + this.$storex.username + "#gg" : "/welcome";
1198
+ return this.$storex && this.$storex.token && this.$storex.username ? "/" + this.$storex.username : "/welcome";
1199
1199
  },
1200
1200
  isAndroid() {
1201
1201
  return /Android/i.test(navigator.userAgent) || Yn.getPlatform() === "android";
@@ -1412,7 +1412,7 @@ function ka(n, e, t, r, o, i) {
1412
1412
  const po = /* @__PURE__ */ mt(ua, [["render", ka], ["__scopeId", "data-v-615ed484"]]), Ca = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1413
1413
  __proto__: null,
1414
1414
  default: po
1415
- }, Symbol.toStringTag, { value: "Module" })), Ea = "0.0.162", hr = {
1415
+ }, Symbol.toStringTag, { value: "Module" })), Ea = "0.0.164", hr = {
1416
1416
  getMe() {
1417
1417
  return ce().get("/users/me");
1418
1418
  },
@@ -5553,7 +5553,7 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5553
5553
  choose_other_login_methods: "다른 로그인 방법 선택하기",
5554
5554
  no_sso_logins: "귀하의 회사는 SSO 로그인을 사용하지 않습니다. 관리자에게 문의하십시오."
5555
5555
  }
5556
- }, Ao = () => Promise.resolve().then(() => Ca), Sa = () => Promise.resolve().then(() => qc), Ia = () => Promise.resolve().then(() => Ul), Aa = () => Promise.resolve().then(() => wd), Ra = () => import("./Account-5TJRQFEr.js"), Pa = () => Promise.resolve().then(() => du), Ma = () => Promise.resolve().then(() => Id), Na = () => import("./QR-KFsWzDOM.js"), Oa = () => Promise.resolve().then(() => xu), La = [
5556
+ }, Ao = () => Promise.resolve().then(() => Ca), Sa = () => Promise.resolve().then(() => qc), Ia = () => Promise.resolve().then(() => Ul), Aa = () => Promise.resolve().then(() => wd), Ra = () => import("./Account--TEqAldR.js"), Pa = () => Promise.resolve().then(() => du), Ma = () => Promise.resolve().then(() => Id), Na = () => import("./QR-BfLf5wTV.js"), Oa = () => Promise.resolve().then(() => xu), La = [
5557
5557
  {
5558
5558
  path: "/welcome",
5559
5559
  name: "AuthWelcome",
@@ -5653,7 +5653,12 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5653
5653
  "https://qrcodetoolkit.com",
5654
5654
  "https://qr.tapni.com",
5655
5655
  "https://designer.tapni.com",
5656
- "https://designer-dev.tapni.com"
5656
+ "https://designer-dev.tapni.com",
5657
+ "http://localhost:8082",
5658
+ "http://localhost:7777",
5659
+ "http://localhost:8086",
5660
+ "https://localhost:8085",
5661
+ "http://localhost:8085"
5657
5662
  ]
5658
5663
  },
5659
5664
  mutations: {
@@ -5807,14 +5812,14 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5807
5812
  );
5808
5813
  if (o && o.response && o.response.data.error === "ACCESS_DENIED")
5809
5814
  return n("logout", { refreshToken: r.refreshToken, sendRequest: !1 }), location.reload();
5810
- i && i.data && n("setToken", i.data.token), e.refreshing = !1;
5815
+ i && i.data && (n("setToken", i.data.token), q.$emit("ssoEvent", { name: "setStorage", data: e.$storex })), e.refreshing = !1;
5811
5816
  },
5812
5817
  async login({ commit: n, state: e, dispatch: t }, r) {
5813
5818
  const [o, i] = await fe($e.login(r));
5814
5819
  if (o)
5815
5820
  return t("errorHandler", o);
5816
5821
  if (i.data.success)
5817
- return e.display, t("loginSetup", { ...i, isModal: r.isModal }), await t("getLoggedInAccounts"), t("loginSuccess", { ...i, isModal: r.isModal }), !0;
5822
+ return e.display !== "popup" && (t("loginSetup", { ...i, isModal: r.isModal }), await t("getLoggedInAccounts")), t("loginSuccess", { ...i, isModal: r.isModal }), !0;
5818
5823
  },
5819
5824
  loginSuccess({ commit: n, state: e, dispatch: t, getters: r }, o) {
5820
5825
  if (e.display === "redirect")
@@ -5989,7 +5994,10 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5989
5994
  },
5990
5995
  getters: {
5991
5996
  isLoggedIn: (n) => !!n.$storex.token && n.$storex.token !== "" && n.$storex.token !== "null",
5992
- renderView: (n) => n.display !== "npm" ? "" : n.view,
5997
+ renderView: (n, e, t) => {
5998
+ var r;
5999
+ return n.display !== "npm" ? (r = t.route) == null ? void 0 : r.name : n.view;
6000
+ },
5993
6001
  appRealm: (n) => n.realm,
5994
6002
  appLanguage: (n) => n.lang,
5995
6003
  accessToken: (n) => n.$storex.token,
@@ -16296,7 +16304,7 @@ const Ai = {
16296
16304
  }, this.$storex));
16297
16305
  if (n)
16298
16306
  return this.errorHandler(n);
16299
- e.data.auth_code && (this.display === "npm" && (this.loginSetup({ ...e, isModal: this.isModal }), await this.getLoggedInAccounts()), this.loginSuccess({ ...e, isModal: this.isModal }), clearInterval(this.poolingInterval), clearInterval(this.qrCodeRefreshInterval));
16307
+ e.data.auth_code && (this.display !== "popup" && (this.loginSetup({ ...e, isModal: this.isModal }), await this.getLoggedInAccounts()), this.loginSuccess({ ...e, isModal: this.isModal }), clearInterval(this.poolingInterval), clearInterval(this.qrCodeRefreshInterval));
16300
16308
  }, 2e3);
16301
16309
  },
16302
16310
  async initQrCodeLogin() {
@@ -16693,7 +16701,7 @@ const wo = /* @__PURE__ */ mt(Vs, [["render", Fc]]), qc = /* @__PURE__ */ Object
16693
16701
  captchaToken: await this.getCaptchaToken("account_verify"),
16694
16702
  ref: this.referral
16695
16703
  }, e = await this.register(n);
16696
- this.submitted = !1, e.data && e.data.success && (e.data.message === "SUCCESS_REGISTER" ? (this.isModal ? q.$emit("ssoEvent", { name: "toggleAddAccountModalVerify", data: !1 }) : this.$router.push("/verify"), this.successSnack(this.ssoLang[this.appLanguage].register_success), this.formButtonText = this.ssoLang[this.appLanguage].check_your_inbox) : e.data.message === "SUCCESS_LOGIN" && (this.display === "npm" && (await this.loginSetup({ ...e, isModal: n.isModal }), await this.getLoggedInAccounts()), await this.loginSuccess({ ...e, isModal: n.isModal })));
16704
+ this.submitted = !1, e.data && e.data.success && (e.data.message === "SUCCESS_REGISTER" ? (this.isModal ? q.$emit("ssoEvent", { name: "toggleAddAccountModalVerify", data: !1 }) : this.$router.push("/verify"), this.successSnack(this.ssoLang[this.appLanguage].register_success), this.formButtonText = this.ssoLang[this.appLanguage].check_your_inbox) : e.data.message === "SUCCESS_LOGIN" && (this.display !== "popup" && (await this.loginSetup({ ...e, isModal: n.isModal }), await this.getLoggedInAccounts()), await this.loginSuccess({ ...e, isModal: n.isModal })));
16697
16705
  },
16698
16706
  close() {
16699
16707
  q.$emit("ssoEvent", { name: "toggleAddAccountModal", data: !0 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapni/auth",
3
- "version": "0.0.162",
3
+ "version": "0.0.164",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
@@ -43,11 +43,14 @@
43
43
  "vue": "^3.3.11",
44
44
  "vue-cookies": "^1.8.3",
45
45
  "vue-router": "^4.2.5",
46
- "vuex": "^4.0.2"
46
+ "vuex": "^4.0.2",
47
+ "vuex-router-sync": "v6.0.0-rc.1"
48
+
47
49
  },
48
50
  "devDependencies": {
49
51
  "@rollup/plugin-inject": "^5.0.5",
50
52
  "@vitejs/plugin-vue": "^4.5.2",
53
+ "office-addin-dev-certs": "^1.13.2",
51
54
  "vite": "^5.0.10",
52
55
  "vite-plugin-node-polyfills": "^0.22.0"
53
56
  }
package/src/main.js CHANGED
@@ -6,11 +6,15 @@ import VueCookies from 'vue-cookies'
6
6
  import { App } from '@capacitor/app';
7
7
  import { Browser } from '@capacitor/browser';
8
8
  import store from './store/store.js';
9
+ import { sync } from 'vuex-router-sync';
9
10
 
10
11
  const app = createApp(RootApp)
11
12
 
12
13
  app.config.productionTip = false
13
14
 
15
+ // Vuex Router Sync
16
+ sync(store, router);
17
+
14
18
  // Cookies
15
19
  app.use(VueCookies)
16
20
 
@@ -4,7 +4,7 @@ export default {
4
4
  computed: {
5
5
  home() {
6
6
  if (this.$storex && this.$storex.token && this.$storex.username) {
7
- if (import.meta.env.VITE_APP_MODE === 'npm') return '/' + this.$storex.username + '#gg'
7
+ if (import.meta.env.VITE_APP_MODE === 'npm') return '/' + this.$storex.username
8
8
  if (import.meta.env.VITE_APP_MODE === 'redirect') return '/account'
9
9
  } else return '/welcome'
10
10
  },
@@ -93,7 +93,7 @@ export default {
93
93
  }, this.$storex));
94
94
  if (err) return this.errorHandler(err);
95
95
  if (response.data.auth_code) {
96
- if (this.display === 'npm') {
96
+ if (this.display !== 'popup') {
97
97
  this.loginSetup({ ...response, isModal: this.isModal });
98
98
  await this.getLoggedInAccounts();
99
99
  }
package/src/store/auth.js CHANGED
@@ -62,6 +62,11 @@ export default {
62
62
  "https://qr.tapni.com",
63
63
  "https://designer.tapni.com",
64
64
  "https://designer-dev.tapni.com",
65
+ "http://localhost:8082",
66
+ "http://localhost:7777",
67
+ "http://localhost:8086",
68
+ "https://localhost:8085",
69
+ "http://localhost:8085"
65
70
  ],
66
71
  },
67
72
  mutations: {
@@ -279,6 +284,7 @@ export default {
279
284
  // Set new access token
280
285
  if (response && response.data) {
281
286
  commit('setToken', response.data.token);
287
+ EventBus.$emit("ssoEvent", { name: "setStorage", data: state.$storex });
282
288
  }
283
289
  state.refreshing = false;
284
290
  },
@@ -286,7 +292,7 @@ export default {
286
292
  const [err, response] = await to(AuthService.login(data));
287
293
  if (err) return dispatch('errorHandler', err);
288
294
  if (response.data.success) {
289
- if (state.display === 'npm' || true) {
295
+ if (state.display !== 'popup') {
290
296
  dispatch('loginSetup', { ...response, isModal: data.isModal });
291
297
  await dispatch('getLoggedInAccounts');
292
298
  }
@@ -540,9 +546,9 @@ export default {
540
546
  isLoggedIn: state => {
541
547
  return !!state.$storex.token && state.$storex.token !== "" && state.$storex.token !== "null";
542
548
  },
543
- renderView: state => {
549
+ renderView: (state, getters, rootState) => {
544
550
  if (state.display !== "npm") {
545
- return '';
551
+ return rootState.route?.name;
546
552
  } else return state.view;
547
553
  },
548
554
  appRealm: state => {
@@ -190,7 +190,7 @@ export default {
190
190
  this.successSnack(this.ssoLang[this.appLanguage].register_success);
191
191
  this.formButtonText = this.ssoLang[this.appLanguage].check_your_inbox
192
192
  } else if (response.data.message === 'SUCCESS_LOGIN') {
193
- if (this.display === 'npm') {
193
+ if (this.display !== 'popup') {
194
194
  await this.loginSetup({ ...response, isModal: data.isModal });
195
195
  await this.getLoggedInAccounts();
196
196
  }