@tapni/auth 0.0.35 → 0.0.37

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.
@@ -1,47 +1,49 @@
1
- import { reactive as Ce, readonly as Te, resolveComponent as V, openBlock as c, createElementBlock as l, createElementVNode as t, toDisplayString as p, createCommentVNode as h, createVNode as v, withCtx as j, createTextVNode as f, pushScopeId as O, popScopeId as B, createStaticVNode as je, nextTick as J, withModifiers as y, normalizeStyle as R, withDirectives as k, withKeys as E, vModelText as x, vModelDynamic as K, vShow as I, createBlock as P, normalizeClass as b, unref as Pe } from "vue";
1
+ import { reactive as Ce, readonly as Te, resolveComponent as V, openBlock as c, createElementBlock as l, createElementVNode as t, toDisplayString as p, createCommentVNode as h, createVNode as v, withCtx as j, createTextVNode as f, pushScopeId as O, popScopeId as B, createStaticVNode as je, nextTick as J, withModifiers as w, normalizeStyle as R, withDirectives as k, withKeys as E, vModelText as x, vModelDynamic as K, vShow as I, createBlock as P, normalizeClass as b, unref as Pe } from "vue";
2
2
  import { RouterView as Ae } from "vue-router";
3
3
  import g from "await-to-js";
4
- import $ from "axios";
4
+ import Y from "axios";
5
5
  import { jwtDecode as te } from "jwt-decode";
6
- import { Device as H } from "@capacitor/device";
6
+ import { Device as $ } from "@capacitor/device";
7
7
  import { Capacitor as D } from "@capacitor/core";
8
8
  import { GoogleAuth as ee } from "@codetrix-studio/capacitor-google-auth";
9
9
  import { FacebookLogin as Ie } from "@capacitor-community/facebook-login";
10
10
  import { SignInWithApple as Ee } from "@capacitor-community/apple-sign-in";
11
11
  import { MsAuthPlugin as xe } from "@recognizebv/capacitor-plugin-msauth";
12
- import { Browser as F } from "@capacitor/browser";
12
+ import { Browser as H } from "@capacitor/browser";
13
13
  import qe from "qr-code-styling";
14
14
  import { sanitizeUrl as Me } from "@braintree/sanitize-url";
15
15
  import "@tapni/capacitor-reactive-localstorage-vue3";
16
- const Re = "0.0.34", m = (e, a = !1) => {
16
+ const Re = "0.0.37", m = (e, a = !1) => {
17
17
  const n = Re;
18
- let o = $.create({
19
- baseURL: "https://api.tapni.co/v1/",
18
+ let o = "https://api.tapni.co/v1/";
19
+ location.hostname.includes("dev.") && (o = "https://api-dev.tapni.co");
20
+ let i = Y.create({
21
+ baseURL: o,
20
22
  headers: {
21
23
  Authorization: `Bearer ${e.token}`,
22
24
  "X-Client-Name": "sso-" + n.platform,
23
25
  "X-Client-Version": n.version
24
26
  }
25
27
  });
26
- return o.interceptors.request.use(async function(i) {
27
- if (["post", "put", "delete"].includes(i.method.toLowerCase()) ? i.data = {
28
- ...i.data,
28
+ return i.interceptors.request.use(async function(r) {
29
+ if (["post", "put", "delete"].includes(r.method.toLowerCase()) ? r.data = {
30
+ ...r.data,
29
31
  lang: e.appLanguage,
30
32
  realm: e.realm || "app"
31
- } : i.method.toLowerCase() === "get" && (i.params = {
32
- ...i.params,
33
+ } : r.method.toLowerCase() === "get" && (r.params = {
34
+ ...r.params,
33
35
  lang: e.appLanguage,
34
36
  realm: e.realm || "app"
35
37
  }), e.token && !a) {
36
- const r = te(e.token);
37
- if (r.exp - 30 < Math.floor(Date.now() / 1e3))
38
- return z.methods.refreshTokenAction(r).then(() => (i.headers = {
39
- ...i.headers,
38
+ const u = te(e.token);
39
+ if (u.exp - 30 < Math.floor(Date.now() / 1e3))
40
+ return z.methods.refreshTokenAction(u).then(() => (r.headers = {
41
+ ...r.headers,
40
42
  Authorization: `Bearer ${e.token}`
41
- }, i));
43
+ }, r));
42
44
  }
43
- return i;
44
- }), o;
45
+ return r;
46
+ }), i;
45
47
  }, M = {
46
48
  getMe() {
47
49
  return m(storage).get("/users/me");
@@ -93,8 +95,8 @@ const Re = "0.0.34", m = (e, a = !1) => {
93
95
  }
94
96
  };
95
97
  let S;
96
- H.getId().then((e) => S = e.uuid);
97
- const w = {
98
+ $.getId().then((e) => S = e.uuid);
99
+ const y = {
98
100
  register(e, a) {
99
101
  return e.device_id = S, m(a).post("/users/register", e);
100
102
  },
@@ -147,8 +149,11 @@ const w = {
147
149
  },
148
150
  samlLoginUrl(e, a) {
149
151
  return m(a).post("/saml/url", e);
152
+ },
153
+ exchangeAuthCode(e, a) {
154
+ return m(a).post("/v1/users/auth-code", e);
150
155
  }
151
- }, Y = {
156
+ }, X = {
152
157
  getBySSOEmail(e, a) {
153
158
  return m(a).get(`/company/sso/${e}`);
154
159
  },
@@ -4410,7 +4415,7 @@ const z = {
4410
4415
  },
4411
4416
  async maintenance() {
4412
4417
  const [e, a] = await g(
4413
- $.get("https://status.tapni.co/data/maintenance.json")
4418
+ Y.get("https://status.tapni.co/data/maintenance.json")
4414
4419
  );
4415
4420
  if (e)
4416
4421
  return console.error(e);
@@ -4456,7 +4461,7 @@ const z = {
4456
4461
  },
4457
4462
  async refreshTokenAction(e) {
4458
4463
  const [a, n] = await g(
4459
- w.refreshToken({
4464
+ y.refreshToken({
4460
4465
  id: e.id,
4461
4466
  refreshToken: this.refreshToken,
4462
4467
  refreshTokenAction: !0
@@ -4464,10 +4469,10 @@ const z = {
4464
4469
  );
4465
4470
  if (a && a.response && a.response.data.error === "ACCESS_DENIED")
4466
4471
  return this.logout(!1), location.reload();
4467
- this.setToken(n.data.token);
4472
+ n && n.data ? this.setToken(n.data.token) : console.error("Invalid response setToken");
4468
4473
  },
4469
4474
  async login(e) {
4470
- const [a, n] = await g(w.login(e, this.$storage));
4475
+ const [a, n] = await g(y.login(e, this.$storage));
4471
4476
  if (a)
4472
4477
  return this.errorHandler(a);
4473
4478
  if (n.data.success)
@@ -4491,36 +4496,31 @@ const z = {
4491
4496
  },
4492
4497
  async register(e) {
4493
4498
  const [a, n] = await g(
4494
- w.register(e, this.$storage)
4499
+ y.register(e, this.$storage)
4495
4500
  );
4496
4501
  return a ? this.errorHandler(a) : n;
4497
4502
  },
4498
4503
  async verify(e) {
4499
- const [a, n] = await g(w.verify(e, this.$storage));
4504
+ const [a, n] = await g(y.verify(e, this.$storage));
4500
4505
  return a ? this.errorHandler(a) : n;
4501
4506
  },
4502
4507
  async reset(e) {
4503
4508
  const [a, n] = await g(
4504
- w.sendResetEmail(e, this.$storage)
4509
+ y.sendResetEmail(e, this.$storage)
4505
4510
  );
4506
4511
  if (a)
4507
4512
  return this.errorHandler(a);
4508
4513
  n.data.success && this.successSnack(this.ssoLang[this.appLanguage].password_reset_success);
4509
4514
  },
4510
4515
  async exchangeAuthCode(e) {
4511
- const [a, n] = await g(
4512
- $.post("https://api.tapni.co/v1/users/auth-code", {
4513
- code: e.code,
4514
- code_verifier: e.code_verifier
4515
- })
4516
- );
4516
+ const [a, n] = await g(y.exchangeAuthCode(e, this.storage));
4517
4517
  if (a)
4518
4518
  return this.errorHandler(a);
4519
4519
  await this.loginSetup(n), await this.getLoggedInAccounts(), this.loginSuccess(n);
4520
4520
  },
4521
4521
  async changePassword(e) {
4522
4522
  const [a, n] = await g(
4523
- w.changePassword(e, this.$storage)
4523
+ y.changePassword(e, this.$storage)
4524
4524
  );
4525
4525
  return a ? this.errorHandler(a) : n.data.success;
4526
4526
  },
@@ -4537,7 +4537,7 @@ const z = {
4537
4537
  return a ? this.errorHandler(a) : n.data.success;
4538
4538
  },
4539
4539
  async registerDevice() {
4540
- const e = await H.getId(), a = await H.getInfo();
4540
+ const e = await $.getId(), a = await $.getInfo();
4541
4541
  let n = {
4542
4542
  device_id: e.uuid,
4543
4543
  platform: a.platform,
@@ -4563,12 +4563,12 @@ const z = {
4563
4563
  },
4564
4564
  async acceptCompanyInvitation(e) {
4565
4565
  const [a, n] = await g(
4566
- Y.acceptCompanyInvitation(e, this.$storage)
4566
+ X.acceptCompanyInvitation(e, this.$storage)
4567
4567
  );
4568
4568
  return a ? this.errorHandler(a) : n;
4569
4569
  },
4570
4570
  async logout(e = !0) {
4571
- e && w.logout({ token: this.refreshToken }, this.$storage), this.$storage.username = null, this.$storage.ssoUser = null, this.$storage.UserId = null, this.setLoggedInUserId(null), this.setToken(null), this.setRefreshToken(null), this.refreshToken ? Object.keys(this.loggedInAccounts).forEach((a) => {
4571
+ e && y.logout({ token: this.refreshToken }, this.$storage), this.$storage.username = null, this.$storage.ssoUser = null, this.$storage.UserId = null, this.setLoggedInUserId(null), this.setToken(null), this.setRefreshToken(null), this.refreshToken ? Object.keys(this.loggedInAccounts).forEach((a) => {
4572
4572
  this.loggedInAccounts[a].refreshToken === this.refreshToken && this.refreshTokenAction({
4573
4573
  id: this.loggedInAccounts[a].id
4574
4574
  }).then(() => (this.setLoggedInUserId(this.loggedInAccounts[a].id), this.$storage.username = a, this.$storage.UserId = this.loggedInAccounts[a].id, this.getLoggedInAccounts(), this.$router.push("/" + a)));
@@ -4576,7 +4576,7 @@ const z = {
4576
4576
  },
4577
4577
  async getCompanyBySSOEmail(e) {
4578
4578
  const [a, n] = await g(
4579
- Y.getBySSOEmail(e.email, this.$storage)
4579
+ X.getBySSOEmail(e.email, this.$storage)
4580
4580
  );
4581
4581
  if (a)
4582
4582
  return this.errorHandler(a);
@@ -4585,7 +4585,7 @@ const z = {
4585
4585
  },
4586
4586
  async getLoggedInAccounts() {
4587
4587
  const e = this.getRefreshTokens(), [a, n] = await g(
4588
- w.getLoggedInAccounts({ refreshTokens: e }, this.$storage)
4588
+ y.getLoggedInAccounts({ refreshTokens: e }, this.$storage)
4589
4589
  );
4590
4590
  if (a)
4591
4591
  return this.errorHandler(a);
@@ -4729,7 +4729,7 @@ const _e = /* @__PURE__ */ T(Be, [["render", Ze], ["__scopeId", "data-v-806183a1
4729
4729
  return this.googleLoad = !1;
4730
4730
  if (this.referral && (a.ref = this.referral), a.authentication && (a.authentication.accessToken || a.authentication.idToken)) {
4731
4731
  this.referral && (a.ref = this.referral), this.display === "popup" && (a.response_type = "code");
4732
- const [o, i] = await g(w.googleSDK(a, this.$storage));
4732
+ const [o, i] = await g(y.googleSDK(a, this.$storage));
4733
4733
  if (o)
4734
4734
  return this.googleLoad = !1, d.$emit("ssoEvent", { name: "setLoading", data: !1 }), this.errorHandler(o);
4735
4735
  if (i.data.success) {
@@ -4782,7 +4782,7 @@ const ge = {
4782
4782
  if (a)
4783
4783
  return this.facebookLoad = !1;
4784
4784
  if (this.referral && (n.ref = this.referral), this.display === "popup" && (n.response_type = "code"), n.accessToken) {
4785
- const [i, r] = await g(w.facebookSDK(n, this.$storage));
4785
+ const [i, r] = await g(y.facebookSDK(n, this.$storage));
4786
4786
  if (i)
4787
4787
  return this.facebookLoad = !1, d.$emit("ssoEvent", { name: "setLoading", data: !1 }), this.errorHandler(i);
4788
4788
  if (r.data.success) {
@@ -4822,7 +4822,7 @@ const ge = {
4822
4822
  return this.appleLoad = !1;
4823
4823
  if (a.response.tokenData = te(a.response.identityToken), a && a.response && a.response.identityToken) {
4824
4824
  this.referral && (a.response.ref = this.referral), this.display === "popup" && (a.response_type = "code");
4825
- const [o, i] = await g(w.appleSDK(a.response, this.$storage));
4825
+ const [o, i] = await g(y.appleSDK(a.response, this.$storage));
4826
4826
  if (o)
4827
4827
  return this.appleLoad = !1, d.$emit("ssoEvent", { name: "setLoading", data: !1 }), this.errorHandler(o);
4828
4828
  if (i.data.success) {
@@ -4839,7 +4839,7 @@ const ge = {
4839
4839
  }
4840
4840
  };
4841
4841
  var Je = { VITE_APP_MODE: "npm", VITE_APP_APP_ROOT: "https://t.link", VITE_APP_API_ROOT: "https://api.tapni.co", VITE_APP_GOOGLE_RECAPTCHA_SITE_KEY: "6LenkC0mAAAAADWBxPOhpmwXCwzCJd7cilNgtOLk", VITE_APP_SSO_ID: "9cd47053-080a-4df8-8fd8-ca4389163fde", VITE_APP_POPUP_LOGIN_ALLOWED_ORIGIN: "https://auth.tapni.com", BASE_URL: "/", MODE: "production", DEV: !1, PROD: !0, SSR: !1 };
4842
- const Q = {
4842
+ const F = {
4843
4843
  data() {
4844
4844
  return {
4845
4845
  microsoftLoad: !1,
@@ -4871,7 +4871,7 @@ const Q = {
4871
4871
  return console.log("Error: " + JSON.stringify(n)), this.microsoftLoad = !1;
4872
4872
  if (this.referral && (o.ref = this.referral), o.response_type = "code", o && (o.accessToken || o.idToken)) {
4873
4873
  const [s, _] = await g(
4874
- w.microsoftSDK(o, this.$storage)
4874
+ y.microsoftSDK(o, this.$storage)
4875
4875
  );
4876
4876
  if (s)
4877
4877
  return this.microsoftLoad = !1, this.microsoftSSOLoad = !1, d.$emit("ssoEvent", { name: "setLoading", data: !1 }), this.errorHandler(s);
@@ -4980,7 +4980,7 @@ const Q = {
4980
4980
  console.log(o);
4981
4981
  }
4982
4982
  }
4983
- }, G = {
4983
+ }, Q = {
4984
4984
  data() {
4985
4985
  return {
4986
4986
  oktaAuth: null
@@ -4997,12 +4997,12 @@ const Q = {
4997
4997
  methods: {
4998
4998
  async exchangeCode(e) {
4999
4999
  var i, r;
5000
- let [a, n] = await g($.post(e.domain + "/v1/token", new URLSearchParams({ code: e.code, client_id: e.clientID, grant_type: "authorization_code", redirect_uri: this.isNative ? "tapni://t.link/callback/okta" : location.origin + "/callback/okta", code_verifier: localStorage.getItem("pkce_code_verifier") })));
5000
+ let [a, n] = await g(Y.post(e.domain + "/v1/token", new URLSearchParams({ code: e.code, client_id: e.clientID, grant_type: "authorization_code", redirect_uri: this.isNative ? "tapni://t.link/callback/okta" : location.origin + "/callback/okta", code_verifier: localStorage.getItem("pkce_code_verifier") })));
5001
5001
  if (a)
5002
5002
  return this.errorHandler(a);
5003
5003
  localStorage.removeItem("pkce_code_verifier");
5004
5004
  let o = { accessToken: (i = n.data) == null ? void 0 : i.access_token, domain: e.domain };
5005
- if (this.display === "popup" && (o.response_type = "code"), [a, n] = await g(w.oktaSDK(o, this.$storage)), a)
5005
+ if (this.display === "popup" && (o.response_type = "code"), [a, n] = await g(y.oktaSDK(o, this.$storage)), a)
5006
5006
  return this.oktaLoad = !1, d.$emit("ssoEvent", { name: "setLoading", data: !1 }), this.errorHandler(a);
5007
5007
  if (n.data.success) {
5008
5008
  if (this.display === "popup")
@@ -5024,7 +5024,7 @@ const Q = {
5024
5024
  if (!this.allowedOrigins.includes(q.origin))
5025
5025
  return console.log("Origin is not allowed!");
5026
5026
  q.data.type === "okta" && (L = q.data.code, await _.exchangeCode({ domain: e.domain, code: L, clientID: e.clientID }));
5027
- }, { once: !0 }), this.isNative ? await F.open({ url: s, presentationStyle: "popover" }) : window.open(s, "popup", "width=600,height=600");
5027
+ }, { once: !0 }), this.isNative ? await H.open({ url: s, presentationStyle: "popover" }) : window.open(s, "popup", "width=600,height=600");
5028
5028
  },
5029
5029
  async handleOktaRedirect() {
5030
5030
  let e = this.$route.query.code, a, n, o, i, r = { type: "okta" };
@@ -5033,10 +5033,10 @@ const Q = {
5033
5033
  const u = new URLSearchParams(a);
5034
5034
  n = u.get("client_id"), o = u.get("domain"), i = u.get("platform");
5035
5035
  }
5036
- window.opener ? (window.opener.postMessage(r, location.origin), window.close()) : (this.isNative && this.isIOS && await F.close(), d.$emit("ssoEvent", { name: "setLoading", data: !0 }), e && n && o && await this.exchangeCode({ code: e, clientID: n, domain: o, platform: i }), localStorage.removeItem("pkce_code_verifier"), d.$emit("ssoEvent", { name: "setLoading", data: !1 }));
5036
+ window.opener ? (window.opener.postMessage(r, location.origin), window.close()) : (this.isNative && this.isIOS && await H.close(), d.$emit("ssoEvent", { name: "setLoading", data: !0 }), e && n && o && await this.exchangeCode({ code: e, clientID: n, domain: o, platform: i }), localStorage.removeItem("pkce_code_verifier"), d.$emit("ssoEvent", { name: "setLoading", data: !1 }));
5037
5037
  }
5038
5038
  }
5039
- }, W = {
5039
+ }, G = {
5040
5040
  data() {
5041
5041
  return {
5042
5042
  code_verifier: "",
@@ -5067,7 +5067,7 @@ const Q = {
5067
5067
  return (r = window.parent) == null ? void 0 : r.postMessage({ code: i.data.code, state: this.$route.query.state, code_verifier: localStorage.getItem("pkce_code_verifier") }, "*");
5068
5068
  await o.exchangeAuthCode({ code: i.data.code, code_verifier: localStorage.getItem("pkce_code_verifier") }), localStorage.removeItem("pkce_code_verifier");
5069
5069
  }
5070
- }, { once: !0 }), this.isNative ? await F.open({ url: e, presentationStyle: "popover" }) : window.open(e, "popup", "width=600,height=600");
5070
+ }, { once: !0 }), this.isNative ? await H.open({ url: e, presentationStyle: "popover" }) : window.open(e, "popup", "width=600,height=600");
5071
5071
  },
5072
5072
  async handleSamlRedirect() {
5073
5073
  var n;
@@ -5075,7 +5075,7 @@ const Q = {
5075
5075
  if (this.$route.query.code && (a.code = this.$route.query.code), window.opener)
5076
5076
  window.opener.postMessage(a, location.origin), window.close();
5077
5077
  else {
5078
- if (this.isNative && this.isIOS && await F.close(), EventBus.$emit("ssoEvent", { name: "setLoading", data: !0 }), this.$route.query.code && (e = this.$route.query.code), e) {
5078
+ if (this.isNative && this.isIOS && await H.close(), EventBus.$emit("ssoEvent", { name: "setLoading", data: !0 }), this.$route.query.code && (e = this.$route.query.code), e) {
5079
5079
  if (this.display === "popup")
5080
5080
  return (n = window.parent) == null ? void 0 : n.postMessage({ code: e, state: this.$route.query.state }, "*");
5081
5081
  await this.exchangeAuthCode({ code: e, code_verifier: localStorage.getItem("pkce_code_verifier") });
@@ -5146,7 +5146,7 @@ const Q = {
5146
5146
  },
5147
5147
  async startQrCodePooling() {
5148
5148
  this.poolingInterval = setInterval(async () => {
5149
- const [e, a] = await g(Y.qrCodePooling({
5149
+ const [e, a] = await g(X.qrCodePooling({
5150
5150
  qrToken: this.qrCodeHash
5151
5151
  }, this.$storage));
5152
5152
  if (e)
@@ -5162,7 +5162,7 @@ const Q = {
5162
5162
  }
5163
5163
  }, aa = {
5164
5164
  name: "AuthLogin",
5165
- mixins: [me, ge, he, Q, G, W, z, ea],
5165
+ mixins: [me, ge, he, F, Q, G, z, ea],
5166
5166
  props: {
5167
5167
  isModal: {
5168
5168
  type: Boolean,
@@ -5323,7 +5323,7 @@ function Wa(e, a, n, o, i, r) {
5323
5323
  const u = V("router-link");
5324
5324
  return c(), l("form", {
5325
5325
  class: "page-login content-boxed content-boxed-padding",
5326
- onSubmit: a[14] || (a[14] = y((...s) => r.submit && r.submit(...s), ["prevent"])),
5326
+ onSubmit: a[14] || (a[14] = w((...s) => r.submit && r.submit(...s), ["prevent"])),
5327
5327
  autocomplete: "on",
5328
5328
  style: R(n.isModal ? "max-width: 500px;" : "")
5329
5329
  }, [
@@ -5344,7 +5344,7 @@ function Wa(e, a, n, o, i, r) {
5344
5344
  sa,
5345
5345
  k(t("input", {
5346
5346
  "onUpdate:modelValue": a[2] || (a[2] = (s) => i.emailOrUsername = s),
5347
- onKeydown: a[3] || (a[3] = E(y(() => {
5347
+ onKeydown: a[3] || (a[3] = E(w(() => {
5348
5348
  }, ["prevent"]), ["space"])),
5349
5349
  autocorrect: "off",
5350
5350
  autocapitalize: "off",
@@ -5490,7 +5490,7 @@ function Wa(e, a, n, o, i, r) {
5490
5490
  }
5491
5491
  const fe = /* @__PURE__ */ T(aa, [["render", Wa]]), Xa = {
5492
5492
  name: "AuthRegister",
5493
- mixins: [me, ge, he, Q, z],
5493
+ mixins: [me, ge, he, F, z],
5494
5494
  props: {
5495
5495
  isModal: {
5496
5496
  type: Boolean,
@@ -5628,7 +5628,7 @@ function Kn(e, a, n, o, i, r) {
5628
5628
  const u = V("router-link");
5629
5629
  return c(), l("form", {
5630
5630
  class: "page-login content-boxed content-boxed-padding",
5631
- onSubmit: a[12] || (a[12] = y((...s) => r.submit && r.submit(...s), ["prevent"])),
5631
+ onSubmit: a[12] || (a[12] = w((...s) => r.submit && r.submit(...s), ["prevent"])),
5632
5632
  autocomplete: "on",
5633
5633
  style: R(n.isModal ? "max-width: 500px;" : "")
5634
5634
  }, [
@@ -5650,7 +5650,7 @@ function Kn(e, a, n, o, i, r) {
5650
5650
  rn,
5651
5651
  k(t("input", {
5652
5652
  "onUpdate:modelValue": a[1] || (a[1] = (s) => i.email = s),
5653
- onKeydown: a[2] || (a[2] = E(y(() => {
5653
+ onKeydown: a[2] || (a[2] = E(w(() => {
5654
5654
  }, ["prevent"]), ["space"])),
5655
5655
  type: "email",
5656
5656
  placeholder: e.ssoLang[this.appLanguage].email,
@@ -5665,7 +5665,7 @@ function Kn(e, a, n, o, i, r) {
5665
5665
  dn,
5666
5666
  k(t("input", {
5667
5667
  "onUpdate:modelValue": a[3] || (a[3] = (s) => i.username = s),
5668
- onKeydown: a[4] || (a[4] = E(y(() => {
5668
+ onKeydown: a[4] || (a[4] = E(w(() => {
5669
5669
  }, ["prevent"]), ["space"])),
5670
5670
  type: "text",
5671
5671
  autocorrect: "off",
@@ -5887,7 +5887,7 @@ function ht(e, a, n, o, i, r) {
5887
5887
  const u = V("router-link");
5888
5888
  return c(), l("form", {
5889
5889
  class: "page-login content-boxed content-boxed-padding",
5890
- onSubmit: a[6] || (a[6] = y((...s) => r.submit && r.submit(...s), ["prevent"])),
5890
+ onSubmit: a[6] || (a[6] = w((...s) => r.submit && r.submit(...s), ["prevent"])),
5891
5891
  style: R(n.isModal ? "max-width: 500px;" : "")
5892
5892
  }, [
5893
5893
  n.isModal ? (c(), l("a", {
@@ -5903,7 +5903,7 @@ function ht(e, a, n, o, i, r) {
5903
5903
  k(t("input", {
5904
5904
  id: "emailInput",
5905
5905
  "onUpdate:modelValue": a[1] || (a[1] = (s) => i.email = s),
5906
- onKeydown: a[2] || (a[2] = E(y(() => {
5906
+ onKeydown: a[2] || (a[2] = E(w(() => {
5907
5907
  }, ["prevent"]), ["space"])),
5908
5908
  type: "email",
5909
5909
  placeholder: e.ssoLang[this.appLanguage].email,
@@ -5918,7 +5918,7 @@ function ht(e, a, n, o, i, r) {
5918
5918
  k(t("input", {
5919
5919
  id: "codeInput",
5920
5920
  "onUpdate:modelValue": a[3] || (a[3] = (s) => i.code = s),
5921
- onKeydown: a[4] || (a[4] = E(y(() => {
5921
+ onKeydown: a[4] || (a[4] = E(w(() => {
5922
5922
  }, ["prevent"]), ["space"])),
5923
5923
  type: "tel",
5924
5924
  placeholder: e.ssoLang[this.appLanguage].code,
@@ -6087,7 +6087,7 @@ function Jt(e, a, n, o, i, r) {
6087
6087
  return i.passwordChange ? (c(), l("form", {
6088
6088
  key: 1,
6089
6089
  class: "page-login content-boxed content-boxed-padding",
6090
- onSubmit: a[7] || (a[7] = y((...s) => r.changePw && r.changePw(...s), ["prevent"]))
6090
+ onSubmit: a[7] || (a[7] = w((...s) => r.changePw && r.changePw(...s), ["prevent"]))
6091
6091
  }, [
6092
6092
  t("h3", qt, p(e.ssoLang[this.appLanguage].password_change), 1),
6093
6093
  t("p", Mt, p(e.ssoLang[this.appLanguage].password_new), 1),
@@ -6149,7 +6149,7 @@ function Jt(e, a, n, o, i, r) {
6149
6149
  ], 32)) : (c(), l("form", {
6150
6150
  key: 0,
6151
6151
  class: "page-login content-boxed content-boxed-padding",
6152
- onSubmit: a[2] || (a[2] = y((...s) => r.resetEmail && r.resetEmail(...s), ["prevent"])),
6152
+ onSubmit: a[2] || (a[2] = w((...s) => r.resetEmail && r.resetEmail(...s), ["prevent"])),
6153
6153
  autocomplete: "on"
6154
6154
  }, [
6155
6155
  t("h3", vt, p(e.ssoLang[this.appLanguage].reset_password), 1),
@@ -6159,7 +6159,7 @@ function Jt(e, a, n, o, i, r) {
6159
6159
  k(t("input", {
6160
6160
  id: "emailInput",
6161
6161
  "onUpdate:modelValue": a[0] || (a[0] = (s) => i.email = s),
6162
- onKeydown: a[1] || (a[1] = E(y(() => {
6162
+ onKeydown: a[1] || (a[1] = E(w(() => {
6163
6163
  }, ["prevent"]), ["space"])),
6164
6164
  type: "email",
6165
6165
  placeholder: e.ssoLang[this.appLanguage].email,
@@ -6207,7 +6207,7 @@ function Jt(e, a, n, o, i, r) {
6207
6207
  }
6208
6208
  const be = /* @__PURE__ */ T(ft, [["render", Jt], ["__scopeId", "data-v-7eff2bb3"]]), ei = {
6209
6209
  name: "AuthCallback",
6210
- mixins: [G, W, z],
6210
+ mixins: [Q, G, z],
6211
6211
  data() {
6212
6212
  return {};
6213
6213
  },
@@ -6279,7 +6279,7 @@ function ri(e, a, n, o, i, r) {
6279
6279
  }
6280
6280
  const we = /* @__PURE__ */ T(oi, [["render", ri], ["__scopeId", "data-v-a128c2fa"]]), si = {
6281
6281
  name: "SSO",
6282
- mixins: [Q, G, W, z],
6282
+ mixins: [F, Q, G, z],
6283
6283
  data() {
6284
6284
  return {
6285
6285
  toggle: !1,
@@ -6338,7 +6338,7 @@ const we = /* @__PURE__ */ T(oi, [["render", ri], ["__scopeId", "data-v-a128c2fa
6338
6338
  };
6339
6339
  function hi(e, a, n, o, i, r) {
6340
6340
  return c(), l("form", {
6341
- onSubmit: a[3] || (a[3] = y((...u) => r.submit && r.submit(...u), ["prevent"])),
6341
+ onSubmit: a[3] || (a[3] = w((...u) => r.submit && r.submit(...u), ["prevent"])),
6342
6342
  class: b(["menu-wrapper menu-light menu-modal center-text activate-page", { "active-menu": i.toggle }]),
6343
6343
  style: { height: "auto", "margin-top": "-172.5px" }
6344
6344
  }, [
@@ -6360,7 +6360,7 @@ function hi(e, a, n, o, i, r) {
6360
6360
  class: "edit-input h-40 lh-40",
6361
6361
  style: { width: "80%" },
6362
6362
  required: "",
6363
- onKeydown: a[2] || (a[2] = E(y(() => {
6363
+ onKeydown: a[2] || (a[2] = E(w(() => {
6364
6364
  }, ["prevent"]), ["space"]))
6365
6365
  }, null, 40, ui), [
6366
6366
  [x, i.email]
@@ -6373,7 +6373,7 @@ function hi(e, a, n, o, i, r) {
6373
6373
  }
6374
6374
  const ze = /* @__PURE__ */ T(si, [["render", hi], ["__scopeId", "data-v-11f19a09"]]), fi = {
6375
6375
  name: "SSOPick",
6376
- mixins: [Q, G, W, z],
6376
+ mixins: [F, Q, G, z],
6377
6377
  data() {
6378
6378
  return {
6379
6379
  toggle: !1,
@@ -6406,7 +6406,7 @@ const ze = /* @__PURE__ */ T(si, [["render", hi], ["__scopeId", "data-v-11f19a09
6406
6406
  this.azureLoad = !1, this.oktaLoad = !1, this.samlLoad = !1, this.sso = null, this.email = null, e && (this.sso = e.sso, this.email = e.email), this.toggle = !this.toggle;
6407
6407
  }
6408
6408
  }
6409
- }, X = (e) => (O("data-v-4f821f65"), e = e(), B(), e), vi = /* @__PURE__ */ X(() => /* @__PURE__ */ t("i", { class: "font-17 color-black" }, [
6409
+ }, W = (e) => (O("data-v-4f821f65"), e = e(), B(), e), vi = /* @__PURE__ */ W(() => /* @__PURE__ */ t("i", { class: "font-17 color-black" }, [
6410
6410
  /* @__PURE__ */ t("img", {
6411
6411
  src: "https://cdn.tapni.co/icons/down-arrow.png",
6412
6412
  class: "responsive-image",
@@ -6414,19 +6414,19 @@ const ze = /* @__PURE__ */ T(si, [["render", hi], ["__scopeId", "data-v-11f19a09
6414
6414
  })
6415
6415
  ], -1)), ki = [
6416
6416
  vi
6417
- ], bi = { class: "bold center-text color-black half-top half-bottom" }, yi = /* @__PURE__ */ X(() => /* @__PURE__ */ t("img", {
6417
+ ], bi = { class: "bold center-text color-black half-top half-bottom" }, yi = /* @__PURE__ */ W(() => /* @__PURE__ */ t("img", {
6418
6418
  src: "https://cdn.tapni.co/icons/azure.png",
6419
6419
  style: { position: "absolute", "margin-left": "-11px", padding: "8px 0", height: "100%" }
6420
6420
  }, null, -1)), wi = { key: 0 }, zi = {
6421
6421
  key: 1,
6422
6422
  class: "button--loading button__loader"
6423
- }, Li = /* @__PURE__ */ X(() => /* @__PURE__ */ t("img", {
6423
+ }, Li = /* @__PURE__ */ W(() => /* @__PURE__ */ t("img", {
6424
6424
  src: "https://cdn.tapni.co/icons/okta.png",
6425
6425
  style: { position: "absolute", "margin-left": "-11px", padding: "8px 0", height: "100%" }
6426
6426
  }, null, -1)), Si = { key: 0 }, Ci = {
6427
6427
  key: 1,
6428
6428
  class: "button--loading button__loader"
6429
- }, Ti = /* @__PURE__ */ X(() => /* @__PURE__ */ t("img", {
6429
+ }, Ti = /* @__PURE__ */ W(() => /* @__PURE__ */ t("img", {
6430
6430
  src: "https://cdn.tapni.co/icons/saml.png",
6431
6431
  style: { position: "absolute", "margin-left": "-11px", padding: "8px 0", height: "100%" }
6432
6432
  }, null, -1)), ji = { key: 0 }, Pi = {
@@ -6436,7 +6436,7 @@ const ze = /* @__PURE__ */ T(si, [["render", hi], ["__scopeId", "data-v-11f19a09
6436
6436
  function Ai(e, a, n, o, i, r) {
6437
6437
  var u, s, _;
6438
6438
  return c(), l("form", {
6439
- onSubmit: a[4] || (a[4] = y(() => {
6439
+ onSubmit: a[4] || (a[4] = w(() => {
6440
6440
  }, ["prevent"])),
6441
6441
  class: b(["menu-wrapper menu-light menu-modal center-text activate-page", { "active-menu": i.toggle }]),
6442
6442
  style: { height: "auto", "margin-top": "-172.5px" }
@@ -6619,7 +6619,7 @@ const Ni = /* @__PURE__ */ T(Ii, [["render", Ri]]), Vi = {
6619
6619
  d.$on("toggleLanguageModal", this.toggleModal), d.$on("closeModal", () => {
6620
6620
  this.toggle = !1;
6621
6621
  });
6622
- let e = this.isNative ? await H.getLanguageCode() : N.getFirstBrowserLanguage();
6622
+ let e = this.isNative ? await $.getLanguageCode() : N.getFirstBrowserLanguage();
6623
6623
  e && Vi.SUPPORTED_LANGUAGES.includes(e) && this.updateLanguage(e);
6624
6624
  },
6625
6625
  beforeDestroy() {
@@ -6754,7 +6754,7 @@ const Fi = { id: "ssoapp" }, Qi = {
6754
6754
  mixins: [z],
6755
6755
  data() {
6756
6756
  return {
6757
- initialized: !1
6757
+ isSetup: !1
6758
6758
  };
6759
6759
  },
6760
6760
  components: {
@@ -6779,14 +6779,19 @@ const Fi = { id: "ssoapp" }, Qi = {
6779
6779
  default: !1
6780
6780
  }
6781
6781
  },
6782
+ computed: {
6783
+ initialized() {
6784
+ return this.isSetup || this.isModal;
6785
+ }
6786
+ },
6782
6787
  async mounted() {
6783
6788
  this.applyBgStyle(), d.$on("ssoEvent", this.ssoOutgoingEvent), d.$on("ssoLogout", (e) => this.logout(e)), d.$on("getLoggedInAccounts", (e) => this.getLoggedInAccounts(e)), d.$on("refreshTokenAction", (e) => this.refreshTokenAction(e));
6784
6789
  },
6785
6790
  methods: {
6786
6791
  async init() {
6787
- if (this.initialized)
6792
+ if (this.isSetup)
6788
6793
  return;
6789
- this.initialized = !0, this.setToken(this.$storage.token);
6794
+ this.isSetup = !0, this.setToken(this.$storage.token);
6790
6795
  const e = this.getRefreshTokens();
6791
6796
  this.setRefreshToken(e[0]), this.getLoggedInAccounts(), this.$emit("ssoLibraryReady");
6792
6797
  },