Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOPID-2566] Refactor AuthErrorComponent #6565

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

ChrisMattew
Copy link
Collaborator

@ChrisMattew ChrisMattew commented Dec 18, 2024

Short description

This PR removes the onRetry function from the AuthErrorScreen navigation params in order to suppress the warning related to it. The retry logic is now handled in a dedicated redux reducer.

Important

In the ts/screens/authentication/IdpLoginScreen.tsx component the navigate method has been replaced with the replace. This change gives us the possibility to skip the retryLollipopLogin step because the replace unmounts the route and in a further navigation on the ts/screens/authentication/IdpLoginScreen.tsx the useLollipopLoginSource hook will be executed from start.

List of changes proposed in this pull request

  • Removed onRetry from the AuthErrorScreen navigation params
  • Added isNativeLogin param into the AuthErrorScreen navigation params
  • Moved the ts/screens/authentication/IdpLoginScreen.tsx and ts/screens/authentication/idpAuthSessionHandler.tsx retry logic in a dedicated redux reducer
  • Replaced the navigate function with the replace function in the ts/screens/authentication/IdpLoginScreen.tsx

Demo

iOS

Standard login

Before After
ios-standard-login-before.mp4
ios-standard-login-after.mp4

Native login

Before After
ios-native-login-before.mp4
ios-native-login-after.mp4
Android

Standard login

Before After
android-standard-login-before.mp4
android-standard-login-after.mp4

Native login

Before After
android-native-login-before.mp4
android-native-login-after.mp4

How to test

Replicate what is shown in the demos. By default, the standard login flow is enabled. To test the native login, ensure that the local feature flag is enabled in the environment variables and that the remote one is enabled on the dev-server.

… params and move spid request states on redux
Copy link
Contributor

github-actions bot commented Dec 18, 2024

Jira Pull Request Link

This Pull Request refers to the following Jira issue IOPID-2566

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

Attention: Patch coverage is 31.91489% with 32 lines in your changes missing coverage. Please review.

Project coverage is 49.29%. Comparing base (9321272) to head (836c550).

Files with missing lines Patch % Lines
ts/features/spidLogin/store/reducers/index.ts 41.17% 10 Missing ⚠️
ts/screens/authentication/AuthErrorScreen.tsx 0.00% 7 Missing ⚠️
ts/screens/authentication/IdpLoginScreen.tsx 0.00% 7 Missing ⚠️
...s/screens/authentication/idpAuthSessionHandler.tsx 0.00% 5 Missing ⚠️
ts/features/spidLogin/store/selectors/index.ts 50.00% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6565      +/-   ##
==========================================
- Coverage   49.29%   49.29%   -0.01%     
==========================================
  Files        1555     1558       +3     
  Lines       32119    32153      +34     
  Branches     7312     7322      +10     
==========================================
+ Hits        15834    15849      +15     
- Misses      16236    16255      +19     
  Partials       49       49              
Files with missing lines Coverage Δ
ts/features/common/store/reducers/index.ts 100.00% <ø> (ø)
ts/features/spidLogin/store/actions/index.ts 100.00% <100.00%> (ø)
ts/features/spidLogin/store/selectors/index.ts 50.00% <50.00%> (ø)
...s/screens/authentication/idpAuthSessionHandler.tsx 4.38% <0.00%> (-0.04%) ⬇️
ts/screens/authentication/AuthErrorScreen.tsx 9.52% <0.00%> (-2.98%) ⬇️
ts/screens/authentication/IdpLoginScreen.tsx 1.86% <0.00%> (ø)
ts/features/spidLogin/store/reducers/index.ts 41.17% <41.17%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9321272...836c550. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO-A&I IO - Autenticazione e Identità
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants