Skip to content

Commit

Permalink
Only add jwt-token projects to invited users
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed May 14, 2024
1 parent 33c1a39 commit f9d2be7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/LexBoxApi/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public async Task<ActionResult<LexAuthUser>> 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();
}
Expand Down

0 comments on commit f9d2be7

Please sign in to comment.