-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[NoQA] Ensure to sign user out if the Authenticate call fails #50388
Conversation
src/libs/Authentication.ts
Outdated
.catch((error) => { | ||
// In case the atuhentication call throws error, we need to sign user out as most likely they are missing credentials | ||
NetworkStore.setIsAuthenticating(false); | ||
Log.hmmm('Redirecting to Sign In because we failed to reauthenticate', {error}); | ||
redirectToSignIn('passwordForm.error.fallback'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the Authenticate call throws error due to missing params, we just entered infinite loop of failing requests as we never catch it and sign user out
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
@nkuoch thank you! Mind reapproving after that copy change? Thanks! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/mountiny in version: 9.0.47-1 🚀
|
🚀 Deployed to production by https://github.com/thienlnam in version: 9.0.47-4 🚀
|
Details
Right now, the user who has malformed credentials onyx key data can run into a loop of trying to reauthenticate and silently failing. The app looks like it's working fine for them due to offline first.
We need to catch if the required params for authenticate calls are missing and sign them out if that is the case.
Fixed Issues
$ #50389
PROPOSAL:
Tests
I am not sure how exactly to test this. We would need to force the client to start reauthenticating while the credentials are malformed. This change is quite transparent so I think we can go ahead with no specific QA steps.
Offline tests
N/A
QA Steps
Nothing specific, this should treat sporadic issues when user looses the credentials locally
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop