Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3401044
D11654.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11654.diff
View Options
diff --git a/lib/reducers/keyserver-reducer.js b/lib/reducers/keyserver-reducer.js
--- a/lib/reducers/keyserver-reducer.js
+++ b/lib/reducers/keyserver-reducer.js
@@ -444,11 +444,24 @@
action.payload.userID !== action.payload.preRequestUserState?.id)
) {
// We want to remove all keyservers but Ashoat's keyserver
- const oldConnection =
- state.keyserverInfos[authoritativeKeyserverID()].connection;
+ const oldKeyserverInfo = state.keyserverInfos[authoritativeKeyserverID()];
+ const oldConnection = oldKeyserverInfo.connection;
const operations: KeyserverStoreOperation[] = [
{ type: 'remove_all_keyservers' },
];
+
+ let cookie = oldKeyserverInfo.cookie;
+ if (
+ action.type === logOutActionTypes.success ||
+ action.type === deleteAccountActionTypes.success ||
+ cookie?.startsWith('user=')
+ ) {
+ // To avoid unnecessary rerenders, we won't clear the authoritative
+ // keyserver's cookie unless it's a logout or an account deletion, or if
+ // the cookie belongs to an actual user (as opposed to an anonymous one)
+ cookie = null;
+ }
+
operations.push({
type: 'replace_keyserver',
payload: {
@@ -465,7 +478,7 @@
queuedActivityUpdates: [],
lateResponses: [],
},
- cookie: null,
+ cookie,
},
},
});
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 10:09 AM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611288
Default Alt Text
D11654.diff (1 KB)
Attached To
Mode
D11654: [lib] Don't clear authoritative keyserver cookie during identity auth
Attached
Detach File
Event Timeline
Log In to Comment