From f9d2be7bacf6e7bc975b8366f65017ecc7976983 Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Tue, 14 May 2024 15:30:25 +0200 Subject: [PATCH] Only add jwt-token projects to invited users --- backend/LexBoxApi/Controllers/UserController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/LexBoxApi/Controllers/UserController.cs b/backend/LexBoxApi/Controllers/UserController.cs index 00319e7e5..d7ae44cff 100644 --- a/backend/LexBoxApi/Controllers/UserController.cs +++ b/backend/LexBoxApi/Controllers/UserController.cs @@ -87,7 +87,7 @@ public async Task> RegisterAccount(RegisterAccountInpu }; registerActivity?.AddTag("app.user.id", userEntity.Id); _lexBoxDbContext.Users.Add(userEntity); - if (jwtUser is not null && !createdByAdmin && jwtUser.Projects.Length > 0) + if (jwtUser?.Audience == LexboxAudience.RegisterAccount) { userEntity.Projects = jwtUser.Projects.Select(p => new ProjectUsers { Role = p.Role, ProjectId = p.ProjectId }).ToList(); }