override MapIdentityApi() to fix confirmation link.
This commit is contained in:
@@ -3,6 +3,7 @@ using Microsoft.AspNetCore.ResponseCompression;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Shogi.Api;
|
||||
using Shogi.Api.Application;
|
||||
using Shogi.Api.Controllers;
|
||||
using Shogi.Api.Identity;
|
||||
using Shogi.Api.Repositories;
|
||||
|
||||
@@ -35,7 +36,7 @@ builder.Services.AddResponseCompression(opts =>
|
||||
});
|
||||
var app = builder.Build();
|
||||
|
||||
app.MapIdentityApi<ShogiUser>();
|
||||
app.MyMapIdentityApi<ShogiUser>(builder.Environment);
|
||||
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
@@ -67,11 +68,11 @@ static void AddIdentity(WebApplicationBuilder builder, ConfigurationManager conf
|
||||
{
|
||||
policy.RequireAuthenticatedUser();
|
||||
policy.RequireAssertion(context => context.User?.Identity?.Name switch
|
||||
{
|
||||
"Hauth@live.com" => true,
|
||||
"aat-account" => true,
|
||||
_ => false
|
||||
});
|
||||
{
|
||||
"Hauth@live.com" => true,
|
||||
"aat-account" => true,
|
||||
_ => false
|
||||
});
|
||||
});
|
||||
|
||||
builder.Services
|
||||
@@ -90,13 +91,6 @@ static void AddIdentity(WebApplicationBuilder builder, ConfigurationManager conf
|
||||
})
|
||||
.AddEntityFrameworkStores<ApplicationDbContext>();
|
||||
|
||||
// I shouldn't this because I have it above, right?
|
||||
//builder.Services.Configure<IdentityOptions>(options =>
|
||||
//{
|
||||
// options.SignIn.RequireConfirmedEmail = true;
|
||||
// options.User.RequireUniqueEmail = true;
|
||||
//});
|
||||
|
||||
builder.Services.ConfigureApplicationCookie(options =>
|
||||
{
|
||||
options.SlidingExpiration = true;
|
||||
|
||||
Reference in New Issue
Block a user