Auto-approve admin created in first time setup

dhcp-server
Pat Hartl 2023-08-11 13:33:24 -05:00
parent 9d99d9b77f
commit 99f8b6d4f5
1 changed files with 3 additions and 0 deletions

View File

@ -136,6 +136,9 @@ namespace LANCommander.Areas.Identity.Pages.Account
{
var user = CreateUser();
user.Approved = true;
user.ApprovedOn = DateTime.Now;
await _userStore.SetUserNameAsync(user, Input.UserName, CancellationToken.None);
var result = await _userManager.CreateAsync(user, Input.Password);