Skip to content

Commit

Permalink
chore: change EIC login flow with the dev server to navigate to `CieC…
Browse files Browse the repository at this point in the history
…onsentDataUsageScreen` (#5788)

## Short description
This PR changes the EIC login flow with the dev server to navigate to
`CieConsentDataUsageScreen`.

<details open><summary>Details</summary>
<p>

| 🤖 | 🍏 | 
| - | - | 
| <video
src="https://github.com/pagopa/io-app/assets/16268789/48dd0fda-a488-4ce1-bc5e-7ac4ea877870"
/> | <video
src="https://github.com/pagopa/io-app/assets/16268789/71b3082c-e02e-41b9-80a2-d5a1a2067021"
/>

</p>
</details> 

## How to test
Set `CIE_LOGIN_WITH_DEV_SERVER_ENABLED=YES` and run the app against the
dev server. Try a login with EIC. You should see a first screen to login
as in the SPID flow. Tapping "Login" you should navigate to
`CieConsentDataUsageScreen` where you see again the screen to login, but
there you can test all the login errors (ex. 22, 25, etc.).

Co-authored-by: Alice Di Rico <83651704+Ladirico@users.noreply.github.com>
  • Loading branch information
shadowsheep1 and Ladirico committed May 23, 2024
1 parent 439e7b0 commit 3bfb1d2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ts/screens/authentication/cie/CiePinScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ import {
import { SafeAreaView } from "react-native-safe-area-context";
import { useSelector } from "react-redux";
import { IdpData } from "../../../../definitions/content/IdpData";
import { CieRequestAuthenticationOverlay } from "../../../components/cie/CieRequestAuthenticationOverlay";
import {
CieEntityIds,
CieRequestAuthenticationOverlay
} from "../../../components/cie/CieRequestAuthenticationOverlay";
import { ContextualHelpPropsMarkdown } from "../../../components/screens/BaseScreenComponent";
import {
BottomTopAnimation,
Expand Down Expand Up @@ -56,6 +59,7 @@ import {
trackLoginCiePinInfo,
trackLoginCiePinScreen
} from "../analytics/cieAnalytics";
import { getIdpLoginUri } from "../../../utils/login";

const CIE_PIN_LENGTH = 8;

Expand Down Expand Up @@ -123,8 +127,10 @@ const CiePinScreen = () => {
useEffect(() => {
if (authUrlGenerated !== undefined) {
if (cieFlowForDevServerEnabled) {
const token = /token=([\d\w]+)/.exec(authUrlGenerated)?.[1];
doLoginSuccess(token as SessionToken, "cie");
const loginUri = getIdpLoginUri(CieEntityIds.PROD, 3);
navigation.navigate(ROUTES.CIE_CONSENT_DATA_USAGE, {
cieConsentUri: loginUri
});
} else {
navigation.navigate(ROUTES.CIE_CARD_READER_SCREEN, {
ciePin: pin,
Expand Down

0 comments on commit 3bfb1d2

Please sign in to comment.