added default user account

This commit is contained in:
Fishandchips321 2026-03-08 19:45:47 +00:00
parent d0fccf299a
commit 6eb863f638

View file

@ -40,6 +40,18 @@ using (var scope = app.Services.CreateScope())
{
var dbContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
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.