Add the language to the user.

This commit is contained in:
Sébastien André
2021-05-17 18:08:19 +02:00
parent 96fbf5cebd
commit bc17e7f789
5 changed files with 16 additions and 9 deletions

View File

@@ -118,7 +118,8 @@ namespace skydiveLogs_api.Controllers
new Claim(ClaimTypes.Name, foundUser.Login),
new Claim(ClaimTypes.UserData, foundUser.Id.ToString()),
new Claim(ClaimTypes.Email, foundUser.Email),
new Claim(ClaimTypes.Role, foundUser.Roles)
new Claim(ClaimTypes.Role, foundUser.Roles),
new Claim("Language", foundUser.Language ?? "")
});
return new JwtSecurityTokenHandler().WriteToken(token);

View File

@@ -11,5 +11,7 @@
public string Password { get; set; }
public string Email { get; set; }
public string Language { get; set; }
}
}
}

View File

@@ -4,7 +4,7 @@
{
public int Id { get; set; }
public string Email { get; set; }
public string Email { get; set; }
public string FirstName { get; set; }
@@ -15,5 +15,7 @@
public string Roles { get; set; }
public string Token { get; set; }
public string Language { get; set; }
}
}
}

View File

@@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="AutoMapper" Version="10.1.1" />
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.6" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="5.0.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.11.0" />
</ItemGroup>