[bug] Account for entityId as a userId alternative during state migration (#622)

Some clients, like Directory Connector, use different key for their user identifier: entityId
We currently only check for userId in the migration service, but need to account for both.
This commit is contained in:
Addison Beck 2022-01-20 14:00:58 -05:00 committed by GitHub
parent 7300db703c
commit cf1e483c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -193,7 +193,8 @@ export class StateMigrationService {
alwaysShowDock: await this.get<boolean>(v1Keys.alwaysShowDock),
};
const userId = await this.get<string>(v1Keys.userId);
const userId =
(await this.get<string>(v1Keys.userId)) ?? (await this.get<string>(v1Keys.entityId));
// (userId == null) = no logged in user (so no known userId) and we need to temporarily store account specific settings in state to migrate on first auth
// (userId != null) = we have a currently authed user (so known userId) with encrypted data and other key settings we can move, no need to temporarily store account settings