|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Security.Claims;
|
|
|
|
using System.Security.Claims;
|
|
|
@ -66,7 +67,8 @@ namespace nuget_host.Controllers
|
|
|
|
ModelState.AddModelError(null, "Maximum key count reached");
|
|
|
|
ModelState.AddModelError(null, "Maximum key count reached");
|
|
|
|
return View();
|
|
|
|
return View();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ApiKey newKey = new ApiKey { UserId = userid, Name = model.Name };
|
|
|
|
ApiKey newKey = new ApiKey { UserId = userid, Name = model.Name,
|
|
|
|
|
|
|
|
CreationDate = DateTime.Now };
|
|
|
|
_ = dbContext.ApiKeys.Add(newKey);
|
|
|
|
_ = dbContext.ApiKeys.Add(newKey);
|
|
|
|
_ = await dbContext.SaveChangesAsync();
|
|
|
|
_ = await dbContext.SaveChangesAsync();
|
|
|
|
return View("Details", new DetailModel { Name = newKey.Name,
|
|
|
|
return View("Details", new DetailModel { Name = newKey.Name,
|
|
|
|