From c7888bf0c6a2a3f72ffc27a2bc98221a02a4bb6f Mon Sep 17 00:00:00 2001 From: Niko Lindroos Date: Tue, 2 Jul 2024 14:18:30 +0300 Subject: [PATCH] fix: auth renewal should not reset a selected project KK-1197. A default project should not be set as an active by an auth renewal process when a project is already selected. --- src/domain/authentication/authorizationService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/domain/authentication/authorizationService.ts b/src/domain/authentication/authorizationService.ts index f7f1d9ef..08394c9c 100644 --- a/src/domain/authentication/authorizationService.ts +++ b/src/domain/authentication/authorizationService.ts @@ -72,7 +72,9 @@ export class AuthorizationService { const projects = ProjectList((data as any)?.projects).items; const role = projects.length > 0 ? 'admin' : 'none'; const projectPermissions = getProjectPermissions(projects); - projectService.setDefaultProjectId(projects); + if (!projectService.projectId) { + projectService.setDefaultProjectId(projects); + } this.setPermissionStorage({ role, projects: projectPermissions }); } catch (error) { // eslint-disable-next-line no-console