aboutsummaryrefslogtreecommitdiff
path: root/src/Web/DevHive.Web/Configurations/Extensions
diff options
context:
space:
mode:
authortranstrike <transtrike@gmail.com>2021-02-16 18:07:51 +0200
committertranstrike <transtrike@gmail.com>2021-02-16 18:07:51 +0200
commit72502154725594cf31878aa944f4bc9d9f3521a3 (patch)
tree6ea1f475f35fba320b32664084d4c39e2d084e49 /src/Web/DevHive.Web/Configurations/Extensions
parenta2ca63701b71eed2ffa3fff6de16b9babe8bba08 (diff)
downloadDevHive-72502154725594cf31878aa944f4bc9d9f3521a3.tar
DevHive-72502154725594cf31878aa944f4bc9d9f3521a3.tar.gz
DevHive-72502154725594cf31878aa944f4bc9d9f3521a3.zip
UserManager&RoleManager logic moved to Repo; Password hashing and validation moved to Repo and using ASPNET Core hashing methods; Added Migrations; Fixed Roles not added to user
Diffstat (limited to 'src/Web/DevHive.Web/Configurations/Extensions')
-rw-r--r--src/Web/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs
index 84108ae..687e83f 100644
--- a/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs
+++ b/src/Web/DevHive.Web/Configurations/Extensions/ConfigureDatabase.cs
@@ -60,7 +60,7 @@ namespace DevHive.Web.Configurations.Extensions
});
}
- public static async Task UseDatabaseConfiguration(this IApplicationBuilder app)
+ public static void UseDatabaseConfiguration(this IApplicationBuilder app)
{
app.UseHttpsRedirection();
app.UseRouting();
@@ -75,21 +75,21 @@ namespace DevHive.Web.Configurations.Extensions
var roleManager = (RoleManager<Role>)serviceScope.ServiceProvider.GetService(typeof(RoleManager<Role>));
- if (!await dbContext.Roles.AnyAsync(x => x.Name == Role.DefaultRole))
+ if (!dbContext.Roles.Any(x => x.Name == Role.DefaultRole))
{
Role defaultRole = new() { Name = Role.DefaultRole };
- await roleManager.CreateAsync(defaultRole);
+ roleManager.CreateAsync(defaultRole).Wait();
}
- if (!await dbContext.Roles.AnyAsync(x => x.Name == Role.AdminRole))
+ if (!dbContext.Roles.Any(x => x.Name == Role.AdminRole))
{
Role adminRole = new() { Name = Role.AdminRole };
- await roleManager.CreateAsync(adminRole);
+ roleManager.CreateAsync(adminRole).Wait();
}
- await dbContext.SaveChangesAsync();
+ dbContext.SaveChanges();
}
}
}