summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-11-20 18:35:47 -0600
committerHombreLaser <sebastian-440@live.com>2022-11-20 18:35:47 -0600
commit4d34da521dd05b16b25d1aa2de2567de9d920512 (patch)
tree0d8062cce645171c8c859f344a2669ae616dd661 /Models
parent45c2616816d62e347cd443a83b184ce5096f3061 (diff)
Añadido signup de usuarios normales
Diffstat (limited to 'Models')
-rw-r--r--Models/ApplicationDbContext.cs19
1 files changed, 0 insertions, 19 deletions
diff --git a/Models/ApplicationDbContext.cs b/Models/ApplicationDbContext.cs
index eda476c..b3b0b15 100644
--- a/Models/ApplicationDbContext.cs
+++ b/Models/ApplicationDbContext.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
-using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
namespace BackendPIA.Models {
@@ -11,21 +7,6 @@ namespace BackendPIA.Models {
protected override void OnModelCreating(ModelBuilder builder) {
base.OnModelCreating(builder);
- string user_id = "24edc3d6-bf9c-41a1-9371-224e4419ccb0";
- string role_id = "d42006bc-7f69-4aa4-b247-eb9e2abfe0ec";
- var hasher = new PasswordHasher<UserAccount>();
- UserAccount user_seed = new UserAccount { Id = user_id, UserName = "admin", Email = "admin@example.com",
- NormalizedEmail = "ADMIN@EXAMPLE.COM", NormalizedUserName = "ADMIN" };
- // TODO: save the seeded admin password in a user secret.
- user_seed.PasswordHash = hasher.HashPassword(user_seed, "admin_password");
- builder.Entity<UserAccount>().HasData(user_seed);
- builder.Entity<IdentityRole>().HasData(new IdentityRole {
- Name = "Administrator",
- NormalizedName = "ADMINISTRATOR",
- Id = role_id,
- ConcurrencyStamp = role_id
- });
- builder.Entity<IdentityUserRole<string>>().HasData(new IdentityUserRole<string> { UserId = user_id, RoleId = role_id });
}
}
}