@pagopa/selfcare-common-frontend 1.34.80 → 1.34.81
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 +9 -2
- package/build.info +2 -2
- package/lib/hooks/useLogin.js +3 -2
- package/lib/hooks/useLogin.js.map +1 -1
- package/lib/utils/api-utils.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file. Dates are d
|
|
|
4
4
|
|
|
5
5
|
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
6
6
|
|
|
7
|
-
#### [v1.34.
|
|
7
|
+
#### [v1.34.81](https://github.com/pagopa/selfcare-common-frontend/compare/v1.35.0...v1.34.81)
|
|
8
8
|
|
|
9
|
+
- fix: update logout URL logic to use consistent variable naming [`#317`](https://github.com/pagopa/selfcare-common-frontend/pull/317)
|
|
9
10
|
- feat: add admin Google login URL and update logout redirection logic [`#316`](https://github.com/pagopa/selfcare-common-frontend/pull/316)
|
|
10
11
|
- update product rendering logic in Header component based on user type [`#315`](https://github.com/pagopa/selfcare-common-frontend/pull/315)
|
|
11
12
|
- [SELC-7957] feat: add fixedParty prop to Header component and update product selection logic [`#314`](https://github.com/pagopa/selfcare-common-frontend/pull/314)
|
|
@@ -137,10 +138,16 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
|
|
137
138
|
- Bump rimraf from 3.0.2 to 6.0.1 [`e6941b9`](https://github.com/pagopa/selfcare-common-frontend/commit/e6941b9e6b05c973d991e2470a851b5ca03926ce)
|
|
138
139
|
- Used a environment variable to manage correct links in the footer based to product and actual environment [`960e2fb`](https://github.com/pagopa/selfcare-common-frontend/commit/960e2fbaa8aa8f79061639b26dc1a27f28b8aae3)
|
|
139
140
|
|
|
140
|
-
#### [v1.35.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.
|
|
141
|
+
#### [v1.35.0](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.80...v1.35.0)
|
|
141
142
|
|
|
142
143
|
> 20 July 2023
|
|
143
144
|
|
|
145
|
+
#### [v1.34.80](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.79...v1.34.80)
|
|
146
|
+
|
|
147
|
+
> 19 November 2025
|
|
148
|
+
|
|
149
|
+
- feat: add admin Google login URL and update logout redirection logic [`#316`](https://github.com/pagopa/selfcare-common-frontend/pull/316)
|
|
150
|
+
|
|
144
151
|
#### [v1.34.79](https://github.com/pagopa/selfcare-common-frontend/compare/v1.34.78...v1.34.79)
|
|
145
152
|
|
|
146
153
|
> 14 November 2025
|
package/build.info
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
20251119.1 - selfcare-common-frontend.deploy(
|
|
2
|
-
tags/v1.29.0~1^2
|
|
1
|
+
20251119.1 - selfcare-common-frontend.deploy(245209)
|
|
2
|
+
tags/v1.29.0~1^2 db9ca15b5a834b574825418361f539af17ed4a11
|
package/lib/hooks/useLogin.js
CHANGED
|
@@ -14,7 +14,7 @@ const mockedUser = {
|
|
|
14
14
|
name: 'loggedName',
|
|
15
15
|
surname: 'loggedSurname',
|
|
16
16
|
email: 'loggedEmail@aa.aa',
|
|
17
|
-
iss: 'SPID'
|
|
17
|
+
iss: 'SPID',
|
|
18
18
|
};
|
|
19
19
|
const useLogin = () => {
|
|
20
20
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
@@ -27,12 +27,13 @@ const useLogin = () => {
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
const sessionStorageUser = storage_1.storageUserOps.read();
|
|
30
|
+
const LOGIN_URL = storage_1.isPagoPaUser ? env_1.CONFIG.URL_FE.LOGIN_ADMIN_GOOGLE : env_1.CONFIG.URL_FE.LOGIN;
|
|
30
31
|
// If there are no credentials, it is impossible to get the user, so
|
|
31
32
|
if ((0, isEmpty_1.default)(sessionStorageUser)) {
|
|
32
33
|
// Remove any partial data that might have remained, just for safety
|
|
33
34
|
storage_1.storageUserOps.delete();
|
|
34
35
|
// Go to the login view
|
|
35
|
-
window.location.assign(
|
|
36
|
+
window.location.assign(LOGIN_URL);
|
|
36
37
|
// This return is necessary
|
|
37
38
|
return;
|
|
38
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLogin.js","sourceRoot":"","sources":["../../../src/lib/hooks/useLogin.ts"],"names":[],"mappings":";;;;AAAA,qEAAqC;AACrC,6CAA0C;AAC1C,uCAAuC;AAEvC,yDAAwD;AACxD,
|
|
1
|
+
{"version":3,"file":"useLogin.js","sourceRoot":"","sources":["../../../src/lib/hooks/useLogin.ts"],"names":[],"mappings":";;;;AAAA,qEAAqC;AACrC,6CAA0C;AAC1C,uCAAuC;AAEvC,yDAAwD;AACxD,8CAAiF;AAEjF,MAAM,SAAS,GAAG,YAAM,CAAC,IAAI,CAAC,GAAG,CAAC;AAElC,MAAM,UAAU,GAAG;IACjB,GAAG,EAAE,GAAG;IACR,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,eAAe;IACxB,KAAK,EAAE,mBAAmB;IAC1B,GAAG,EAAE,MAAM;CACZ,CAAC;AAEK,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,MAAM,QAAQ,GAAG,IAAA,yBAAW,GAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,CAAC,IAAU,EAAE,EAAE,CAAC,QAAQ,CAAC,uBAAW,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAE1E,MAAM,kBAAkB,GAAG,KAAK,IAAI,EAAE;QACpC,IAAI,YAAM,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YAC3B,OAAO,CAAC,UAAU,CAAC,CAAC;YACpB,yBAAe,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YACjC,wBAAc,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACjC,OAAO;QACT,CAAC;QAED,MAAM,kBAAkB,GAAG,wBAAc,CAAC,IAAI,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,sBAAY,CAAC,CAAC,CAAC,YAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAExF,oEAAoE;QACpE,IAAI,IAAA,iBAAO,EAAC,kBAAkB,CAAC,EAAE,CAAC;YAChC,oEAAoE;YACpE,wBAAc,CAAC,MAAM,EAAE,CAAC;YACxB,uBAAuB;YACvB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAClC,2BAA2B;YAC3B,OAAO;QACT,CAAC;QAED,2DAA2D;QAC3D,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC9B,CAAC,CAAC;IAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAChC,CAAC,CAAC;AA9BW,QAAA,QAAQ,YA8BnB"}
|
package/lib/utils/api-utils.js
CHANGED
|
@@ -27,7 +27,7 @@ const buildFetchApi = (timeoutMs = 300000) => {
|
|
|
27
27
|
return fetchWithTimeout;
|
|
28
28
|
};
|
|
29
29
|
exports.buildFetchApi = buildFetchApi;
|
|
30
|
-
const
|
|
30
|
+
const LOGIN_URL = storage_1.isPagoPaUser ? env_1.CONFIG.URL_FE.LOGIN_ADMIN_GOOGLE : env_1.CONFIG.URL_FE.LOGOUT;
|
|
31
31
|
/** Extract the response of a @pagopa/openapi-codegen-ts generated client rest invocation having status code successHttpStatus.
|
|
32
32
|
If notValidTokenHttpStatus is not null and the returned status is equal to notValidTokenHttpStatus, it will call the onRedirectToLogin function and will schedule the redirect towards logout path.
|
|
33
33
|
If notAuthorizedTokenHttpStatus is not null and the returned status is equal to notAuthorizedTokenHttpStatus, it will throw an Error with message "Operation not allowed".
|
|
@@ -41,7 +41,7 @@ const extractResponse = async (response, successHttpStatus, onRedirectToLogin, n
|
|
|
41
41
|
}
|
|
42
42
|
else if (notValidTokenHttpStatus && response.right.status === notValidTokenHttpStatus) {
|
|
43
43
|
onRedirectToLogin();
|
|
44
|
-
window.setTimeout(() => window.location.assign(
|
|
44
|
+
window.setTimeout(() => window.location.assign(LOGIN_URL), 2000);
|
|
45
45
|
return new Promise(() => null);
|
|
46
46
|
}
|
|
47
47
|
else if (notAuthorizedTokenHttpStatus &&
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagopa/selfcare-common-frontend",
|
|
3
3
|
"description": "Shared React components for the pagopa selfcare project",
|
|
4
|
-
"version": "1.34.
|
|
4
|
+
"version": "1.34.81",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/pagopa/selfcare-common-frontend",
|
|
7
7
|
"author": "https://www.pagopa.gov.it",
|