Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feat/pn-4727
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaCimini90 committed May 17, 2024
2 parents f7b5b89 + 186bd48 commit 6f72fd0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ const SpidSelect = ({ onBack }: { onBack: () => void }) => {
SPID_IDP_ID: IDP.entityId,
});

PFLoginEventStrategyFactory.triggerEvent(PFLoginEventsType.SEND_LOGIN_METHOD, {
entityID: IDP.entityId,
});

window.location.assign(
`${URL_API_LOGIN}/login?entityID=${IDP.entityId}&authLevel=SpidL2&RelayState=send`
);
Expand Down
12 changes: 10 additions & 2 deletions packages/pn-personafisica-login/src/pages/success/Success.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { useCallback, useEffect, useMemo } from 'react';

import { AppRouteParams, sanitizeString } from '@pagopa-pn/pn-commons';

import { PFLoginEventsType } from '../../models/PFLoginEventsType';
import { getConfiguration } from '../../services/configuration.service';
import PFLoginEventStrategyFactory from '../../utility/MixpanelUtils/PFLoginEventStrategyFactory';
import { storageAarOps } from '../../utility/storage';

const SuccessPage = () => {
Expand All @@ -26,12 +28,18 @@ const SuccessPage = () => {
if (redirectUrl && [PF_URL].findIndex((url) => url && redirectUrl.startsWith(url)) > -1) {
window.location.replace(`${redirectUrl}${sanitizeString(token)}`);
}

sessionStorage.removeItem('IDP');
}, [aar, token]);

useEffect(() => {
calcRedirectUrl();

const IDP = sessionStorage.getItem('IDP');

PFLoginEventStrategyFactory.triggerEvent(PFLoginEventsType.SEND_LOGIN_METHOD, {
entityID: IDP,
});

sessionStorage.removeItem('IDP');
}, []);

return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/pn-personafisica-webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const App = () => {

PFEventStrategyFactory.triggerEvent(PFEventsType.SEND_TOAST_ERROR, {
reason: error.code,
traceid: traceId,
traceId,
page_name: getCurrentEventTypePage(pathname),
message: error.message,
httpStatusCode: status,
Expand Down

0 comments on commit 6f72fd0

Please sign in to comment.