moved the IdentityService.cs to services and warnings are now errors

This commit is contained in:
James Tombleson 2023-07-23 22:52:18 -07:00
parent d7242c12c8
commit 7b24ba16f7
2 changed files with 9 additions and 4 deletions

View File

@ -3,13 +3,13 @@ using System.Security.Claims;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Newsbot.Collector.Api.Domain.Results; using Newsbot.Collector.Domain.Results;
using Newsbot.Collector.Database;
using Newsbot.Collector.Domain.Entities; using Newsbot.Collector.Domain.Entities;
using Newsbot.Collector.Domain.Interfaces; using Newsbot.Collector.Domain.Interfaces;
using Newsbot.Collector.Domain.Models.Config; using Newsbot.Collector.Domain.Models.Config;
using JwtRegisteredClaimNames = Microsoft.IdentityModel.JsonWebTokens.JwtRegisteredClaimNames;
namespace Newsbot.Collector.Api.Services; namespace Newsbot.Collector.Services;
public interface IIdentityService public interface IIdentityService
{ {
@ -60,7 +60,7 @@ public class IdentityService : IIdentityService
{ {
return new AuthenticationResult return new AuthenticationResult
{ {
ErrorMessage = new[] { createdUser.Result.Errors.Select(x => x.Description).ToString() } ErrorMessage = new List<string>(createdUser.Result.Errors.Select(x => x.Description))
}; };
} }

View File

@ -11,11 +11,14 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.IdentityModel.JsonWebTokens" Version="6.15.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.15.1" />
<PackageReference Include="Selenium.WebDriver" Version="4.8.1" /> <PackageReference Include="Selenium.WebDriver" Version="4.8.1" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.32.2" /> <PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.32.2" />
<PackageReference Include="Serilog" Version="2.12.0" /> <PackageReference Include="Serilog" Version="2.12.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" /> <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="1.0.0-dev-00113" /> <PackageReference Include="Serilog.Sinks.OpenTelemetry" Version="1.0.0-dev-00113" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.15.1" />
<PackageReference Include="System.ServiceModel.Syndication" Version="7.0.0" /> <PackageReference Include="System.ServiceModel.Syndication" Version="7.0.0" />
</ItemGroup> </ItemGroup>
@ -23,6 +26,8 @@
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup> </PropertyGroup>
</Project> </Project>