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

Sync Logout across tabs #5190

Merged
merged 4 commits into from
Sep 13, 2021
Merged
Changes from 1 commit
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
4 changes: 4 additions & 0 deletions src/libs/actions/SignInRedirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ function redirectToSignIn(errorMessage) {
if (activeClients && activeClients.length > 0) {
Onyx.set(ONYXKEYS.ACTIVE_CLIENTS, activeClients);
}

// We must set the authToken to null so that signOut action is triggered across other clients
// https://github.com/Expensify/App/issues/4971#issuecomment-916101493
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAB, I wonder if we need the link to the issue. If someone is curious about this we can use git blame and hopefully learn why some decision was made.

Onyx.set(ONYXKEYS.SESSION, {authToken: null});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this going to overwrite the error message above? Since we are calling Onyx.set() with ONYXKEYS.SESSION if we have an errorMessage and then again here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I didn't notice. I think I can merge both together.

});
}

Expand Down