feat(account): enable native account management and register API Identity services
Some checks failed
Dotnet build and test / build (pull_request) Has been cancelled
Some checks failed
Dotnet build and test / build (pull_request) Has been cancelled
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
5e22b9a232
commit
f050ee4456
9 changed files with 1402 additions and 102 deletions
|
|
@ -1,6 +1,7 @@
|
|||
|
||||
using Anthropic.SDK;
|
||||
using IdentityModel;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Yavsc.Abstract.Interfaces;
|
||||
|
|
@ -86,6 +87,16 @@ internal class Program
|
|||
options.UseNpgsql(builder.Configuration.GetConnectionString(
|
||||
Yavsc.Constants.YavscConnectionStringName)));
|
||||
|
||||
services.AddIdentityCore<ApplicationUser>(options =>
|
||||
{
|
||||
options.ClaimsIdentity.UserNameClaimType = JwtClaimTypes.PreferredUserName;
|
||||
options.ClaimsIdentity.RoleClaimType = Constants.RoleClaimType;
|
||||
})
|
||||
.AddRoles<IdentityRole>()
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>()
|
||||
.AddDefaultTokenProviders()
|
||||
.AddSignInManager();
|
||||
|
||||
services.AddLocalization(options =>
|
||||
{
|
||||
options.ResourcesPath = "Resources";
|
||||
|
|
|
|||
Loading…
Reference in a new issue