adata-ui 3.1.70 → 3.1.71

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/dist/module.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "nuxt": ">=3.16.0"
6
6
  },
7
7
  "failOnWarn": false,
8
- "version": "3.1.70",
8
+ "version": "3.1.71",
9
9
  "builder": {
10
10
  "@nuxt/module-builder": "1.0.1",
11
11
  "unbuild": "3.5.0"
@@ -11,6 +11,9 @@ const { commonAuth } = useAppConfig();
11
11
  const { t, locale } = useI18n();
12
12
  const { pk, landing } = useUrls();
13
13
  const route = useRoute();
14
+ const appConfig = useAppConfig();
15
+ const mode = appConfig.adataUI.mode;
16
+ const COOKIE_DOMAIN = `.${mode}.kz`;
14
17
  const regex = /^\/counterparty\/main\/company\/\d+\/basic-info$/;
15
18
  const { loginModal, registrationModal, recoveryModal, confirmAccountOtpModal, twoFactorModal, intermediateState } = useIdModals();
16
19
  const authApiURL = commonAuth.authApiURL;
@@ -31,6 +34,7 @@ function getError(path) {
31
34
  function savePassAndLogin(form2) {
32
35
  const { username, password } = form2;
33
36
  const cookieOptions = {
37
+ domain: COOKIE_DOMAIN,
34
38
  expires: rememberMe.value ? new Date(Date.now() + 14 * 24 * 60 * 60 * 1e3) : void 0
35
39
  // Срок действия 14 дней
36
40
  };
@@ -38,13 +42,14 @@ function savePassAndLogin(form2) {
38
42
  useCookie("password", cookieOptions).value = password;
39
43
  }
40
44
  function clearAuthCookie() {
41
- useCookie("username").value = null;
42
- useCookie("password").value = null;
45
+ const options = { domain: COOKIE_DOMAIN };
46
+ useCookie("username", options).value = null;
47
+ useCookie("password", options).value = null;
43
48
  }
44
49
  const loading = ref(false);
45
50
  const form = reactive({
46
- username: useCookie("username").value || "",
47
- password: useCookie("password").value || ""
51
+ username: useCookie("username", { domain: COOKIE_DOMAIN }).value || "",
52
+ password: useCookie("password", { domain: COOKIE_DOMAIN }).value || ""
48
53
  });
49
54
  const rememberMe = ref(false);
50
55
  async function submit() {
@@ -107,7 +112,7 @@ async function submit() {
107
112
  const hostname = location.hostname.split(".").reverse();
108
113
  useCookie("accessToken", {
109
114
  maxAge: expire_in,
110
- domain: `.${hostname[1]}.${hostname[0]}`,
115
+ domain: COOKIE_DOMAIN,
111
116
  path: "/",
112
117
  secure: true
113
118
  }).value = access_token;
@@ -142,8 +147,8 @@ async function submit() {
142
147
  }
143
148
  }
144
149
  function authWithSocial(social) {
145
- const mode = authApiURL.includes("adata") ? "adata" : "adtdev";
146
- document.location.replace(`https://auth.${mode}.kz/api/login/social?source=${social}`);
150
+ const mode2 = authApiURL.includes("adata") ? "adata" : "adtdev";
151
+ document.location.replace(`https://auth.${mode2}.kz/api/login/social?source=${social}`);
147
152
  }
148
153
  function onRegister() {
149
154
  loginModal.value = false;
@@ -158,7 +163,8 @@ function toTariffs() {
158
163
  });
159
164
  }
160
165
  onMounted(() => {
161
- rememberMe.value = !!useCookie("username").value && !!useCookie("password").value;
166
+ const options = { domain: COOKIE_DOMAIN };
167
+ rememberMe.value = !!useCookie("username", options).value && !!useCookie("password", options).value;
162
168
  });
163
169
  function handleEnter(e) {
164
170
  if (e.key === "Enter") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adata-ui",
3
- "version": "3.1.70",
3
+ "version": "3.1.71",
4
4
  "description": "Adata UI",
5
5
  "repository": "your-org/my-module",
6
6
  "license": "MIT",