Fix Identity urls to 1024
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
dotnet ef migrations script \
|
dotnet ef migrations script \
|
||||||
--startup-project src/Web/Web.csproj \
|
--startup-project src/Web/Web.csproj \
|
||||||
--project src/Web/Web.csproj \
|
--project src/Web/Web.csproj \
|
||||||
--context Hutopy.Web.Features.Users.Data.IdentityDbContext \
|
--context Hutopy.Web.Features.Users.Data.ApplicationDbContext \
|
||||||
--configuration Debug \
|
--configuration Debug \
|
||||||
--output create-identity-db.sql \
|
--output create-identity-db.sql \
|
||||||
--idempotent \
|
--idempotent \
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public static class DependencyInjection
|
|||||||
services.AddHttpContextAccessor();
|
services.AddHttpContextAccessor();
|
||||||
|
|
||||||
services.AddHealthChecks()
|
services.AddHealthChecks()
|
||||||
.AddDbContextCheck<IdentityDbContext>();
|
.AddDbContextCheck<ApplicationDbContext>();
|
||||||
|
|
||||||
services.AddRazorPages();
|
services.AddRazorPages();
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
namespace Hutopy.Web.Features.Users.Data
|
namespace Hutopy.Web.Features.Users.Data
|
||||||
{
|
{
|
||||||
public class IdentityDbContext(
|
public class ApplicationDbContext(
|
||||||
DbContextOptions<IdentityDbContext> options)
|
DbContextOptions<ApplicationDbContext> options)
|
||||||
: IdentityDbContext<IdentityUser, IdentityRole, Guid>(options)
|
: IdentityDbContext<IdentityUser, IdentityRole, Guid>(options)
|
||||||
{
|
{
|
||||||
public const string SchemaName = "Identity";
|
public const string SchemaName = "Identity";
|
||||||
@@ -8,7 +8,7 @@ public static class InitializerExtensions
|
|||||||
{
|
{
|
||||||
using var scope = app.Services.CreateScope();
|
using var scope = app.Services.CreateScope();
|
||||||
|
|
||||||
var initializer = scope.ServiceProvider.GetRequiredService<IdentityDbContextInitializer>();
|
var initializer = scope.ServiceProvider.GetRequiredService<ApplicationDbContextInitializer>();
|
||||||
|
|
||||||
await initializer.InitialiseAsync();
|
await initializer.InitialiseAsync();
|
||||||
|
|
||||||
@@ -16,9 +16,9 @@ public static class InitializerExtensions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class IdentityDbContextInitializer(
|
public class ApplicationDbContextInitializer(
|
||||||
ILogger<IdentityDbContextInitializer> logger,
|
ILogger<ApplicationDbContextInitializer> logger,
|
||||||
IdentityDbContext context,
|
ApplicationDbContext context,
|
||||||
RoleManager<IdentityRole> roleManager)
|
RoleManager<IdentityRole> roleManager)
|
||||||
{
|
{
|
||||||
public async Task InitialiseAsync()
|
public async Task InitialiseAsync()
|
||||||
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace Hutopy.Web.Features.Users.Data.Migrations
|
namespace Hutopy.Web.Features.Users.Data.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(IdentityDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20241020183421_Initial")]
|
[Migration("20241020183421_Initial")]
|
||||||
partial class Initial
|
partial class Initial
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace Hutopy.Web.Features.Users.Data.Migrations
|
namespace Hutopy.Web.Features.Users.Data.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(IdentityDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
[Migration("20250217034117_Add_FacebookId")]
|
[Migration("20250217034117_Add_FacebookId")]
|
||||||
partial class Add_FacebookId
|
partial class Add_FacebookId
|
||||||
{
|
{
|
||||||
|
|||||||
308
backend/src/Web/Features/Users/Data/Migrations/20250402025554_FixUrlsTo1024Chars.Designer.cs
generated
Normal file
308
backend/src/Web/Features/Users/Data/Migrations/20250402025554_FixUrlsTo1024Chars.Designer.cs
generated
Normal file
@@ -0,0 +1,308 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
using System;
|
||||||
|
using Hutopy.Web.Features.Users.Data;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Hutopy.Web.Features.Users.Data.Migrations
|
||||||
|
{
|
||||||
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
|
[Migration("20250402025554_FixUrlsTo1024Chars")]
|
||||||
|
partial class FixUrlsTo1024Chars
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
|
{
|
||||||
|
#pragma warning disable 612, 618
|
||||||
|
modelBuilder
|
||||||
|
.HasDefaultSchema("Identity")
|
||||||
|
.HasAnnotation("ProductVersion", "9.0.3")
|
||||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hutopy.Web.Features.Users.IdentityRole", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("RoleNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoles", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Hutopy.Web.Features.Users.IdentityUser", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<int>("AccessFailedCount")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("Address")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
|
b.Property<string>("Alias")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
|
b.Property<DateTime?>("BirthDate")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("ConcurrencyStamp")
|
||||||
|
.IsConcurrencyToken()
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Email")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<bool>("EmailConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("FacebookId")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
|
b.Property<string>("Firstname")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
|
b.Property<string>("GoogleId")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
|
b.Property<string>("Lastname")
|
||||||
|
.HasMaxLength(255)
|
||||||
|
.HasColumnType("character varying(255)");
|
||||||
|
|
||||||
|
b.Property<bool>("LockoutEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("LockoutEnd")
|
||||||
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedEmail")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("NormalizedUserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.Property<string>("PasswordHash")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("PhoneNumberConfirmed")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("PortraitUrl")
|
||||||
|
.HasMaxLength(1024)
|
||||||
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
|
b.Property<string>("SecurityStamp")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<bool>("TwoFactorEnabled")
|
||||||
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
|
b.Property<string>("UserName")
|
||||||
|
.HasMaxLength(256)
|
||||||
|
.HasColumnType("character varying(256)");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedEmail")
|
||||||
|
.HasDatabaseName("EmailIndex");
|
||||||
|
|
||||||
|
b.HasIndex("NormalizedUserName")
|
||||||
|
.IsUnique()
|
||||||
|
.HasDatabaseName("UserNameIndex");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUsers", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("RoleId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetRoleClaims", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<int>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
||||||
|
|
||||||
|
b.Property<string>("ClaimType")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ClaimValue")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("Id");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserClaims", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderKey")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ProviderDisplayName")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("LoginProvider", "ProviderKey");
|
||||||
|
|
||||||
|
b.HasIndex("UserId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserLogins", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<Guid>("RoleId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "RoleId");
|
||||||
|
|
||||||
|
b.HasIndex("RoleId");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserRoles", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("UserId")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<string>("LoginProvider")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Value")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("UserId", "LoginProvider", "Name");
|
||||||
|
|
||||||
|
b.ToTable("AspNetUserTokens", "Identity");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hutopy.Web.Features.Users.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hutopy.Web.Features.Users.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hutopy.Web.Features.Users.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hutopy.Web.Features.Users.IdentityRole", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("RoleId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("Hutopy.Web.Features.Users.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<System.Guid>", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("Hutopy.Web.Features.Users.IdentityUser", null)
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("UserId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Hutopy.Web.Features.Users.Data.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class FixUrlsTo1024Chars : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "PortraitUrl",
|
||||||
|
schema: "Identity",
|
||||||
|
table: "AspNetUsers",
|
||||||
|
type: "character varying(1024)",
|
||||||
|
maxLength: 1024,
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "character varying(255)",
|
||||||
|
oldMaxLength: 255,
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "PortraitUrl",
|
||||||
|
schema: "Identity",
|
||||||
|
table: "AspNetUsers",
|
||||||
|
type: "character varying(255)",
|
||||||
|
maxLength: 255,
|
||||||
|
nullable: true,
|
||||||
|
oldClrType: typeof(string),
|
||||||
|
oldType: "character varying(1024)",
|
||||||
|
oldMaxLength: 1024,
|
||||||
|
oldNullable: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace Hutopy.Web.Features.Users.Data.Migrations
|
namespace Hutopy.Web.Features.Users.Data.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(IdentityDbContext))]
|
[DbContext(typeof(ApplicationDbContext))]
|
||||||
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
partial class ApplicationDbContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
@@ -18,7 +18,7 @@ namespace Hutopy.Web.Features.Users.Data.Migrations
|
|||||||
#pragma warning disable 612, 618
|
#pragma warning disable 612, 618
|
||||||
modelBuilder
|
modelBuilder
|
||||||
.HasDefaultSchema("Identity")
|
.HasDefaultSchema("Identity")
|
||||||
.HasAnnotation("ProductVersion", "8.0.10")
|
.HasAnnotation("ProductVersion", "9.0.3")
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||||
|
|
||||||
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
||||||
@@ -121,8 +121,8 @@ namespace Hutopy.Web.Features.Users.Data.Migrations
|
|||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
|
|
||||||
b.Property<string>("PortraitUrl")
|
b.Property<string>("PortraitUrl")
|
||||||
.HasMaxLength(255)
|
.HasMaxLength(1024)
|
||||||
.HasColumnType("character varying(255)");
|
.HasColumnType("character varying(1024)");
|
||||||
|
|
||||||
b.Property<string>("SecurityStamp")
|
b.Property<string>("SecurityStamp")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|||||||
@@ -14,8 +14,8 @@ public static class DependencyInjection
|
|||||||
builder.Services.AddDbContext<MessagingDbContext>(configureAction);
|
builder.Services.AddDbContext<MessagingDbContext>(configureAction);
|
||||||
builder.Services.AddScoped<MessagingDbContextInitializer>();
|
builder.Services.AddScoped<MessagingDbContextInitializer>();
|
||||||
|
|
||||||
builder.Services.AddDbContext<IdentityDbContext>(configureAction);
|
builder.Services.AddDbContext<ApplicationDbContext>(configureAction);
|
||||||
builder.Services.AddScoped<IdentityDbContextInitializer>();
|
builder.Services.AddScoped<ApplicationDbContextInitializer>();
|
||||||
|
|
||||||
builder.Services.AddAuthentication()
|
builder.Services.AddAuthentication()
|
||||||
.AddBearerToken(IdentityConstants.BearerScheme);
|
.AddBearerToken(IdentityConstants.BearerScheme);
|
||||||
@@ -26,7 +26,7 @@ public static class DependencyInjection
|
|||||||
.AddIdentityCore<IdentityUser>()
|
.AddIdentityCore<IdentityUser>()
|
||||||
.AddUserManager<IdentityUserManager>()
|
.AddUserManager<IdentityUserManager>()
|
||||||
.AddRoles<IdentityRole>()
|
.AddRoles<IdentityRole>()
|
||||||
.AddEntityFrameworkStores<IdentityDbContext>()
|
.AddEntityFrameworkStores<ApplicationDbContext>()
|
||||||
.AddApiEndpoints()
|
.AddApiEndpoints()
|
||||||
.AddSignInManager<SignInManager<IdentityUser>>()
|
.AddSignInManager<SignInManager<IdentityUser>>()
|
||||||
.AddDefaultTokenProviders();
|
.AddDefaultTokenProviders();
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public class IdentityUser : IdentityUser<Guid>
|
|||||||
[MaxLength(255)] public string? Lastname { get; set; }
|
[MaxLength(255)] public string? Lastname { get; set; }
|
||||||
public DateTime? BirthDate { get; set; }
|
public DateTime? BirthDate { get; set; }
|
||||||
[MaxLength(255)] public string? Address { get; set; }
|
[MaxLength(255)] public string? Address { get; set; }
|
||||||
[MaxLength(255)] public string? PortraitUrl { get; set; }
|
[MaxLength(1024)] public string? PortraitUrl { get; set; }
|
||||||
[MaxLength(255)] public string? GoogleId { get; set; }
|
[MaxLength(255)] public string? GoogleId { get; set; }
|
||||||
[MaxLength(255)] public string? FacebookId { get; set; }
|
[MaxLength(255)] public string? FacebookId { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ builder.Services.AddFastEndpoints();
|
|||||||
builder.AddIdentityModule(options =>
|
builder.AddIdentityModule(options =>
|
||||||
options.UseNpgsql(
|
options.UseNpgsql(
|
||||||
postgresConnectionString,
|
postgresConnectionString,
|
||||||
o => o.MigrationsHistoryTable("__EFMigrationsHistory", IdentityDbContext.SchemaName)));
|
o => o.MigrationsHistoryTable("__EFMigrationsHistory", ApplicationDbContext.SchemaName)));
|
||||||
builder.AddContentModule(options =>
|
builder.AddContentModule(options =>
|
||||||
options.UseNpgsql(
|
options.UseNpgsql(
|
||||||
postgresConnectionString,
|
postgresConnectionString,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
dotnet ef database update \
|
dotnet ef database update \
|
||||||
--startup-project src/Web/Web.csproj \
|
--startup-project src/Web/Web.csproj \
|
||||||
--project src/Web/Web.csproj \
|
--project src/Web/Web.csproj \
|
||||||
--context Hutopy.Web.Features.Users.Data.IdentityDbContext \
|
--context Hutopy.Web.Features.Users.Data.ApplicationDbContext \
|
||||||
--configuration Debug \
|
--configuration Debug \
|
||||||
--no-build
|
--no-build
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user