Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/libs/actions/SignInRedirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

let currentIsOffline: boolean | undefined;
let currentShouldForceOffline: boolean | undefined;
Onyx.connect({

Check warning on line 12 in src/libs/actions/SignInRedirect.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NETWORK,
callback: (network) => {
currentIsOffline = network?.isOffline;
Expand All @@ -34,20 +34,11 @@
keysToPreserve.push(ONYXKEYS.NETWORK);
}

// Preserve troubleshooting flags
keysToPreserve.push(ONYXKEYS.APP_PROFILING_IN_PROGRESS);
keysToPreserve.push(ONYXKEYS.SHOULD_STORE_LOGS);
keysToPreserve.push(ONYXKEYS.SHOULD_MASK_ONYX_STATE);

// Preserve account settings (staging server, debug mode, etc.) across logout
keysToPreserve.push(ONYXKEYS.ACCOUNT);

return Onyx.clear(keysToPreserve).then(() => {
if (CONFIG.IS_HYBRID_APP) {
resetSignInFlow();
}
clearAllPolicies();

if (!errorMessage) {
return;
}
Expand Down
3 changes: 1 addition & 2 deletions src/pages/signin/SignInPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ function getRenderOptions({
// SAML required users may reload the login page after having already entered their login details, in which
// case we want to clear their sign in data so they don't end up in an infinite loop redirecting back to their
// SSO provider's login page
// Don't clear if we don't have account data - this prevents clearing during app resets when state is inconsistent
if (hasAccount && hasLogin && isSAMLRequired && !shouldInitiateSAMLLogin && !hasInitiatedSAMLLogin && !account.isLoading) {
if (hasLogin && isSAMLRequired && !shouldInitiateSAMLLogin && !hasInitiatedSAMLLogin && !account.isLoading) {
clearSignInData();
}

Expand Down
Loading