stavroskasidis / BlazorWithIdentity

A project template for a blazor hosted app using cookie based authentication with ef core identity.
MIT License
458 stars 106 forks source link

There's an issue with the login of users who have more than one role … #32

Open angelneychev opened 1 year ago

angelneychev commented 1 year ago

There's an issue with the login of users who have more than one role assigned. To address the "An item with the same key has already been added" error, we need to adjust ExposedClaims.

Solution: ExposedClaims = this.User.Claims.GroupBy(c => c.Type).ToDictionary(g => g.Key, g => string.Join(", ", g.Select(c => c.Value))),