Files
webdoorcreator/WebDoorCreator.Data/UserConfiguration.cs
T
2023-03-09 11:58:03 +01:00

68 lines
2.6 KiB
C#

using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Reflection.Emit;
namespace WebDoorCreator.Data
{
public class UserConfiguration : IEntityTypeConfiguration<IdentityUser>
{
#region Public Methods
public void Configure(EntityTypeBuilder<IdentityUser> builder)
{
var hasher = new PasswordHasher<IdentityUser>();
// Default seeded users
builder.HasData(
//SuperAdmins
new IdentityUser
{
UserName = "zaccaria.majid@egalware.com",
NormalizedUserName = "ZACCARIA.MAJID@EGALWARE.COM",
Email = "zaccaria.majid@egalware.com",
NormalizedEmail = "ZACCARIA.MAJID@EGALWARE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "th1sIsTh3R1vrOfThNgt98"),
},
new IdentityUser
{
UserName = "samuele.locatelli@egalware.com",
NormalizedUserName = "SAMUELE.LOCATELLI@EGALWARE.COM",
Email = "samuele.locatelli@egalware.com",
NormalizedEmail = "SAMUELE.LOCATELLI@EGALWARE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "th1sIsTh3R1vrOfThNgt96"),
},
//Admin
new IdentityUser
{
UserName = "zaccaria.majid.01@egalware.com",
NormalizedUserName = "ZACCARIA.MAJID.01@EGALWARE.COM",
Email = "zaccaria.majid.01@egalware.com",
NormalizedEmail = "ZACCARIA.MAJID.01@EGALWARE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "th1sIsTh3R1vrOfThNgt94"),
},
//companyAdmin
new IdentityUser
{
UserName = "zaccaria.majid.02@egalware.com",
NormalizedUserName = "ZACCARIA.MAJID.02@EGALWARE.COM",
Email = "zaccaria.majid.02@egalware.com",
NormalizedEmail = "ZACCARIA.MAJID.02@EGALWARE.COM",
EmailConfirmed = true,
PasswordHash = hasher.HashPassword(null, "th1sIsTh3R1vrOfThNgt92"),
}
);
}
#endregion Public Methods
}
}