@zauru-sdk/components 6.17.0 → 6.18.0
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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [6.18.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.17.0...@zauru-sdk/components@6.18.0) (2026-10-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* preservar estado local al reautenticar webapps ([e1f76e6](https://github.com/intuitiva/zauru-typescript-sdk/commit/e1f76e6fe06a76c9dc183b0d1af91439f4cadea7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [6.17.0](https://github.com/intuitiva/zauru-typescript-sdk/compare/@zauru-sdk/components@6.16.1...@zauru-sdk/components@6.17.0) (2026-10-29)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFetcher } from "@remix-run/react";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { isOauthUserinfoUnauthorizedError } from "@zauru-sdk/common";
|
|
4
|
+
import { hasZauruOauthReauthCookie, isOauthUserinfoUnauthorizedError, } from "@zauru-sdk/common";
|
|
5
5
|
import { useValidateNotifications } from "@zauru-sdk/hooks";
|
|
6
6
|
import { cleanLocalStorage, profileFetchSuccess, useAppDispatch, } from "@zauru-sdk/redux";
|
|
7
7
|
import { ErrorLayout } from "../Layouts/errorLayout/index.js";
|
|
@@ -41,9 +41,7 @@ export function ZauruLoginPage({ cleanLocalStorageArgs, color, }) {
|
|
|
41
41
|
setIsClient(true);
|
|
42
42
|
}, []);
|
|
43
43
|
useEffect(() => {
|
|
44
|
-
const alreadyReauthed = document.cookie
|
|
45
|
-
.split(";")
|
|
46
|
-
.some((part) => part.trim() === "zauru_oauth_reauth=1");
|
|
44
|
+
const alreadyReauthed = hasZauruOauthReauthCookie(document.cookie);
|
|
47
45
|
if (fetcher.data?.error &&
|
|
48
46
|
!alreadyReauthed &&
|
|
49
47
|
isOauthUserinfoUnauthorizedError(String(fetcher.data?.description ?? ""))) {
|
|
@@ -51,7 +49,12 @@ export function ZauruLoginPage({ cleanLocalStorageArgs, color, }) {
|
|
|
51
49
|
}
|
|
52
50
|
}, [fetcher.data]);
|
|
53
51
|
useEffect(() => {
|
|
54
|
-
|
|
52
|
+
// A reauthentication refreshes the same user's expired server session.
|
|
53
|
+
// Keep every local draft/queue intact; normal logins still clean storage
|
|
54
|
+
// and honor the app-specific whitelist.
|
|
55
|
+
if (!hasZauruOauthReauthCookie(document.cookie)) {
|
|
56
|
+
cleanLocalStorage(cleanLocalStorageArgs);
|
|
57
|
+
}
|
|
55
58
|
fetcher.submit({ action: "login" }, { method: "post" });
|
|
56
59
|
}, []);
|
|
57
60
|
if (!isClient) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zauru-sdk/components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.18.0",
|
|
4
4
|
"description": "Componentes reutilizables en las WebApps de Zauru.",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"@reduxjs/toolkit": "^2.2.1",
|
|
45
45
|
"@remix-run/node": "^2.8.1",
|
|
46
46
|
"@remix-run/react": "^2.8.1",
|
|
47
|
-
"@zauru-sdk/common": "^6.
|
|
48
|
-
"@zauru-sdk/hooks": "^6.4.
|
|
47
|
+
"@zauru-sdk/common": "^6.14.0",
|
|
48
|
+
"@zauru-sdk/hooks": "^6.4.2",
|
|
49
49
|
"@zauru-sdk/icons": "^6.2.0",
|
|
50
50
|
"@zauru-sdk/redux": "^6.8.2",
|
|
51
51
|
"@zauru-sdk/types": "^6.29.0",
|
|
52
|
-
"@zauru-sdk/utils": "^6.
|
|
52
|
+
"@zauru-sdk/utils": "^6.30.0",
|
|
53
53
|
"browser-image-compression": "^2.0.2",
|
|
54
54
|
"framer-motion": "^12.0.0",
|
|
55
55
|
"jsonwebtoken": "^9.0.2",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"styled-components": "^5.3.5",
|
|
63
63
|
"zod": "^3.23.8"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "8e5cb991b0da7d1a5d70cd6275d7bfdc52ee1102"
|
|
66
66
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { useFetcher } from "@remix-run/react";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
hasZauruOauthReauthCookie,
|
|
5
|
+
isOauthUserinfoUnauthorizedError,
|
|
6
|
+
} from "@zauru-sdk/common";
|
|
4
7
|
import { useValidateNotifications } from "@zauru-sdk/hooks";
|
|
5
8
|
import {
|
|
6
9
|
cleanLocalStorage,
|
|
@@ -71,9 +74,7 @@ export function ZauruLoginPage({
|
|
|
71
74
|
}, []);
|
|
72
75
|
|
|
73
76
|
useEffect(() => {
|
|
74
|
-
const alreadyReauthed = document.cookie
|
|
75
|
-
.split(";")
|
|
76
|
-
.some((part) => part.trim() === "zauru_oauth_reauth=1");
|
|
77
|
+
const alreadyReauthed = hasZauruOauthReauthCookie(document.cookie);
|
|
77
78
|
if (
|
|
78
79
|
fetcher.data?.error &&
|
|
79
80
|
!alreadyReauthed &&
|
|
@@ -86,7 +87,12 @@ export function ZauruLoginPage({
|
|
|
86
87
|
}, [fetcher.data]);
|
|
87
88
|
|
|
88
89
|
useEffect(() => {
|
|
89
|
-
|
|
90
|
+
// A reauthentication refreshes the same user's expired server session.
|
|
91
|
+
// Keep every local draft/queue intact; normal logins still clean storage
|
|
92
|
+
// and honor the app-specific whitelist.
|
|
93
|
+
if (!hasZauruOauthReauthCookie(document.cookie)) {
|
|
94
|
+
cleanLocalStorage(cleanLocalStorageArgs);
|
|
95
|
+
}
|
|
90
96
|
fetcher.submit({ action: "login" }, { method: "post" });
|
|
91
97
|
}, []);
|
|
92
98
|
|