@tapni/auth 0.0.130 → 0.0.132

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.
@@ -1052,7 +1052,7 @@ const cs = {
1052
1052
  "redirect_uri",
1053
1053
  "response_type",
1054
1054
  "state",
1055
- "allowedOrigins"
1055
+ "allowedOriginsAuth"
1056
1056
  ]),
1057
1057
  ...ds([
1058
1058
  "isLoggedIn",
@@ -1186,7 +1186,7 @@ function Es(n, e, t, r, o, i) {
1186
1186
  const So = /* @__PURE__ */ _t(ps, [["render", Es], ["__scopeId", "data-v-3d89d57a"]]), Ts = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1187
1187
  __proto__: null,
1188
1188
  default: So
1189
- }, Symbol.toStringTag, { value: "Module" })), Ss = "0.0.130", yr = {
1189
+ }, Symbol.toStringTag, { value: "Module" })), Ss = "0.0.132", yr = {
1190
1190
  getMe() {
1191
1191
  return ce().get("/users/me");
1192
1192
  },
@@ -5327,7 +5327,7 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5327
5327
  choose_other_login_methods: "다른 로그인 방법 선택하기",
5328
5328
  no_sso_logins: "귀하의 회사는 SSO 로그인을 사용하지 않습니다. 관리자에게 문의하십시오."
5329
5329
  }
5330
- }, Qo = () => Promise.resolve().then(() => Ts), As = () => Promise.resolve().then(() => Zl), Rs = () => Promise.resolve().then(() => Qu), Ps = () => Promise.resolve().then(() => Ap), Ms = () => import("./Account-7o_hss4i.js"), Ns = () => Promise.resolve().then(() => wd), Os = () => Promise.resolve().then(() => xp), Ls = () => import("./QR-pMMYqleP.js"), xs = () => Promise.resolve().then(() => Kd), zs = [
5330
+ }, Qo = () => Promise.resolve().then(() => Ts), As = () => Promise.resolve().then(() => Zl), Rs = () => Promise.resolve().then(() => Qu), Ps = () => Promise.resolve().then(() => Ap), Ms = () => import("./Account-DN_5QFOl.js"), Ns = () => Promise.resolve().then(() => wd), Os = () => Promise.resolve().then(() => xp), Ls = () => import("./QR-KjkCkFzI.js"), xs = () => Promise.resolve().then(() => Kd), zs = [
5331
5331
  {
5332
5332
  path: "/welcome",
5333
5333
  name: "AuthWelcome",
@@ -5410,7 +5410,7 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5410
5410
  redirect_uri: "https://t.link/callback/auth",
5411
5411
  response_type: "token",
5412
5412
  state: "",
5413
- allowedOrigins: [
5413
+ allowedOriginsAuth: [
5414
5414
  "https://business.tapni.com",
5415
5415
  "https://business-dev.tapni.com",
5416
5416
  "https://tapni.com",
@@ -5590,10 +5590,10 @@ Tanıştığınız herkesi etkileyin 😎 <br> Kendinize bir tane ayırın 👇`
5590
5590
  },
5591
5591
  loginSuccess({ commit: n, state: e, dispatch: t, getters: r }, o) {
5592
5592
  if (e.display === "redirect")
5593
- return e.redirect_uri && !e.allowedOrigins.some(
5593
+ return e.redirect_uri && !e.allowedOriginsAuth.some(
5594
5594
  (i) => e.redirect_uri.startsWith(i)
5595
5595
  ) ? console.error("Redirect URI not allowed") : Us.push("/account");
5596
- e.display === "popup" ? e.allowedOrigins.forEach((i) => {
5596
+ e.display === "popup" ? e.allowedOriginsAuth.forEach((i) => {
5597
5597
  var a;
5598
5598
  (a = window.parent) == null || a.postMessage(
5599
5599
  { code: o.data.auth_code, state: e.state },
@@ -14976,7 +14976,7 @@ const Vc = Dr("MsAuthPlugin", {
14976
14976
  this.isNative ? a = "tapni://t.link/callback/okta" : a = location.origin + "/callback/okta";
14977
14977
  let s = i + "?response_type=code&client_id=" + encodeURIComponent(n.clientID) + "&state=" + encodeURIComponent(t) + "&scope=" + encodeURIComponent("openid email profile") + "&redirect_uri=" + encodeURIComponent(a) + "&code_challenge=" + encodeURIComponent(o) + "&code_challenge_method=S256", c = this, p;
14978
14978
  window.addEventListener("message", async (l) => {
14979
- if (!this.allowedOrigins.includes(l.origin))
14979
+ if (!this.allowedOriginsAuth.includes(l.origin))
14980
14980
  return console.log("Origin is not allowed!");
14981
14981
  l.data.type === "okta" && (p = l.data.code, await c.exchangeCode({ domain: n.domain, code: p, clientID: n.clientID }));
14982
14982
  }, { once: !0 }), this.isNative ? await Tr.open({ url: s, presentationStyle: "popover" }) : window.open(s, "popup", "width=600,height=600");
@@ -15015,7 +15015,7 @@ const Vc = Dr("MsAuthPlugin", {
15015
15015
  let o = this;
15016
15016
  window.addEventListener("message", async (i) => {
15017
15017
  var a;
15018
- if (!this.allowedOrigins.includes(i.origin))
15018
+ if (!this.allowedOriginsAuth.includes(i.origin))
15019
15019
  return console.log("Origin is not allowed!");
15020
15020
  if (i.data.type === "saml" && i.data.code) {
15021
15021
  if (this.display === "popup")
@@ -18993,10 +18993,6 @@ const Uh = { id: "ssoapp" }, Bh = {
18993
18993
  type: Boolean,
18994
18994
  default: !1
18995
18995
  },
18996
- appLang: {
18997
- type: String,
18998
- default: "en"
18999
- },
19000
18996
  payload: {
19001
18997
  type: Object,
19002
18998
  default: {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapni/auth",
3
- "version": "0.0.130",
3
+ "version": "0.0.132",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
package/src/App.vue CHANGED
@@ -123,10 +123,6 @@ export default {
123
123
  type: Boolean,
124
124
  default: false
125
125
  },
126
- appLang: {
127
- type: String,
128
- default: 'en'
129
- },
130
126
  payload: {
131
127
  type: Object,
132
128
  default: {}
@@ -17,7 +17,7 @@ export default {
17
17
  'redirect_uri',
18
18
  'response_type',
19
19
  'state',
20
- 'allowedOrigins'
20
+ 'allowedOriginsAuth'
21
21
  ]),
22
22
  ...mapGetters([
23
23
  'isLoggedIn',
@@ -89,7 +89,7 @@ export default {
89
89
  //if (response && response.data && response.data.url) {
90
90
  let code;
91
91
  window.addEventListener("message", async (message)=> {
92
- if (!this.allowedOrigins.includes(message.origin)) return console.log('Origin is not allowed!');
92
+ if (!this.allowedOriginsAuth.includes(message.origin)) return console.log('Origin is not allowed!');
93
93
  if(message.data.type === 'okta') {
94
94
  code = message.data.code;
95
95
  await self.exchangeCode({domain: data.domain, code, clientID: data.clientID});
@@ -39,7 +39,7 @@ export default {
39
39
  let self = this;
40
40
 
41
41
  window.addEventListener("message", async (message)=> {
42
- if (!this.allowedOrigins.includes(message.origin)) return console.log('Origin is not allowed!');
42
+ if (!this.allowedOriginsAuth.includes(message.origin)) return console.log('Origin is not allowed!');
43
43
  if(message.data.type === 'saml' && message.data.code) {
44
44
  if (this.display === 'popup') {
45
45
  return window.parent?.postMessage({ code: message.data.code, state: this.$route.query.state, code_verifier: localStorage.getItem("pkce_code_verifier") }, '*');
package/src/store/auth.js CHANGED
@@ -44,7 +44,7 @@ export default {
44
44
  redirect_uri: import.meta.env.VITE_APP_APP_ROOT + "/callback/auth",
45
45
  response_type: "token",
46
46
  state: "",
47
- allowedOrigins: [
47
+ allowedOriginsAuth: [
48
48
  "https://business.tapni.com",
49
49
  "https://business-dev.tapni.com",
50
50
  "https://tapni.com",
@@ -301,7 +301,7 @@ export default {
301
301
  loginSuccess({ commit, state, dispatch, getters }, response) {
302
302
  if (state.display === "redirect") {
303
303
  if (state.redirect_uri &&
304
- !state.allowedOrigins.some((domain) =>
304
+ !state.allowedOriginsAuth.some((domain) =>
305
305
  state.redirect_uri.startsWith(domain)
306
306
  )
307
307
  ) {
@@ -316,7 +316,7 @@ export default {
316
316
  "&state=" +
317
317
  state.state;
318
318
  } else if (state.display === "popup") {
319
- state.allowedOrigins.forEach((domain) => {
319
+ state.allowedOriginsAuth.forEach((domain) => {
320
320
  window.parent?.postMessage(
321
321
  { code: response.data.auth_code, state: state.state },
322
322
  domain