Skip to content

Commit

Permalink
chore: [IOBP-525] Fix payment authorization webview on Android devices (
Browse files Browse the repository at this point in the history
#5474)

Depends on pagopa/io-react-native-login-utils#11

## Short description
This PR updates the library
[io-react-native-login-utils](https://github.com/pagopa/io-react-native-login-utils).
This new version of the library allows Android users to navigate to
other apps while authorizing payment, avoiding closing the webview as
soon as the user brings the IO app to the background.

## List of changes proposed in this pull request
- Update `io-react-native-login-utils` depencency

## How to test
Within **Profile > Playgrounds > New Wallet > Payment**, start a new
payment flow. During the payment authorization, which is handler by a
web view, try to navigate to other apps. Check that you can still
finalize the payment.

## Preview


https://github.com/pagopa/io-app/assets/6160324/2b0b9882-5f81-40f9-8159-0e257c7240c2
  • Loading branch information
mastro993 authored Feb 9, 2024
1 parent 20e54f4 commit d67f85f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@pagopa/io-app-design-system": "1.22.0",
"@pagopa/io-pagopa-commons": "^3.1.0",
"@pagopa/io-react-native-crypto": "^0.2.1",
"@pagopa/io-react-native-login-utils": "^0.2.2",
"@pagopa/io-react-native-login-utils": "^1.0.0",
"@pagopa/io-react-native-zendesk": "^0.3.28",
"@pagopa/react-native-cie": "1.2.0",
"@pagopa/ts-commons": "^10.15.0",
Expand Down
4 changes: 2 additions & 2 deletions ts/screens/authentication/idpAuthSessionHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,12 @@ export const AuthSessionPage = () => {
(error?: LoginUtilsError) => {
void mixpanelTrack("SPID_ERROR", {
idp,
description: error?.userInfo.Error,
description: error?.userInfo?.error,
errorType: ErrorType.LOADING_ERROR
});

const backPressed: LoginUtilsErrorType = "NativeAuthSessionClosed";
if (error?.userInfo.Error === backPressed) {
if (error?.userInfo?.error === backPressed) {
onBack();
return;
}
Expand Down
6 changes: 3 additions & 3 deletions ts/utils/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ export function trackSpidLoginError(
if (isLoginUtilsError(e)) {
void mixpanelTrack(eventName, {
idp: idpName,
code: e.userInfo.StatusCode,
description: e.userInfo.Error,
domain: e.userInfo.URL
code: e.userInfo?.statusCode,
description: e.userInfo?.error,
domain: e.userInfo?.url
});
} else {
const error = e as Error;
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3310,10 +3310,10 @@
resolved "https://registry.yarnpkg.com/@pagopa/io-react-native-crypto/-/io-react-native-crypto-0.2.1.tgz#3d62b0f0cf45b2a878e4ee0652239ea69089988e"
integrity sha512-J+VP1kLXl1lQSJJYFMa+ljW9fWgMIYQskBJZFaVKPrtrZr8MJyrhNzlFUf2/EGwxm3kA+7o7budq6fPqdfVvvg==

"@pagopa/io-react-native-login-utils@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@pagopa/io-react-native-login-utils/-/io-react-native-login-utils-0.2.2.tgz#9b37787f98d94fac645e70bda926638b14e59d0d"
integrity sha512-rOChvrMsJ5QvfLvcsttGP6M5LZkOWhOD2YVRL4+bMCVqNRMsSDmteBNoMWzWlRcXrKyd2ZORgDEa1zPmMRMhTw==
"@pagopa/io-react-native-login-utils@^1.0.0":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@pagopa/io-react-native-login-utils/-/io-react-native-login-utils-1.0.0.tgz#26aa8fe2ae2c30f18d2714264524fd281f0f2b12"
integrity sha512-9OXV4ebpZAGdFfbV5HOt0YbVhGvVb104KshCA7u74YnsTkJp32FhdIVwoqmerRwNO4rRjwwvDjWZdhT80IrOzA==

"@pagopa/io-react-native-zendesk@^0.3.28":
version "0.3.28"
Expand Down

0 comments on commit d67f85f

Please sign in to comment.