File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,21 @@ function redirectToSignIn(errorMessage) {
41
41
if ( preferredLocale ) {
42
42
Onyx . set ( ONYXKEYS . NVP_PREFERRED_LOCALE , preferredLocale ) ;
43
43
}
44
- if ( errorMessage ) {
45
- Onyx . set ( ONYXKEYS . SESSION , { error : errorMessage } ) ;
46
- }
47
44
if ( activeClients && activeClients . length > 0 ) {
48
45
Onyx . set ( ONYXKEYS . ACTIVE_CLIENTS , activeClients ) ;
49
46
}
47
+
48
+ const session = {
49
+ // We must set the authToken to null so that signOut action is triggered across other clients
50
+ authToken : null ,
51
+ } ;
52
+
53
+ if ( errorMessage ) {
54
+ session . error = errorMessage ;
55
+ }
56
+
57
+ // `Onyx.clear` reinitialize the Onyx instance with initial values so use `Onyx.merge` instead of `Onyx.set`.
58
+ Onyx . merge ( ONYXKEYS . SESSION , session ) ;
50
59
} ) ;
51
60
}
52
61
You can’t perform that action at this time.
0 commit comments