added default user account
This commit is contained in:
parent
d0fccf299a
commit
6eb863f638
1 changed files with 12 additions and 0 deletions
|
|
@ -40,6 +40,18 @@ using (var scope = app.Services.CreateScope())
|
||||||
{
|
{
|
||||||
var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
|
||||||
dbContext.Database.Migrate();
|
dbContext.Database.Migrate();
|
||||||
|
|
||||||
|
if (dbContext.Logins.FirstOrDefault(l => l.Username == "Admin") == null)
|
||||||
|
{
|
||||||
|
dbContext.Logins.Add(new JellyGlass.Models.UserLogin()
|
||||||
|
{
|
||||||
|
Username = "Admin",
|
||||||
|
HashedPassword = "$2a$12$NM6PozGL.auxReuOC/xUve9NMIP.Uork1jljb6/0.VZAs1GkvY1xC",
|
||||||
|
IsAdmin = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure the HTTP request pipeline.
|
// Configure the HTTP request pipeline.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue