allow entry of name during installation

This commit is contained in:
sbwalker
2025-01-17 11:14:35 -05:00
parent 4bc26f13c1
commit 677f68b08d
5 changed files with 26 additions and 12 deletions

View File

@ -60,9 +60,9 @@ namespace Oqtane.Controllers
{
installation = _databaseManager.Install(config);
if (installation.Success && config.Register)
if (installation.Success)
{
await RegisterContact(config.HostEmail);
await RegisterContact(config.HostEmail, config.HostName);
}
}
else
@ -257,7 +257,7 @@ namespace Oqtane.Controllers
}
}
private async Task RegisterContact(string email)
private async Task RegisterContact(string email, string name)
{
try
{
@ -268,7 +268,7 @@ namespace Oqtane.Controllers
{
client.DefaultRequestHeaders.Add("Referer", HttpContext.Request.Scheme + "://" + HttpContext.Request.Host.Value);
client.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(Constants.PackageId, Constants.Version));
var response = await client.GetAsync(new Uri(url + $"/api/registry/contact/?id={_configManager.GetInstallationId()}&email={WebUtility.UrlEncode(email)}")).ConfigureAwait(false);
var response = await client.GetAsync(new Uri(url + $"/api/registry/contact/?id={_configManager.GetInstallationId()}&email={WebUtility.UrlEncode(email)}&name={WebUtility.UrlEncode(name)}")).ConfigureAwait(false);
}
}
}
@ -278,12 +278,12 @@ namespace Oqtane.Controllers
}
}
// GET api/<controller>/register?email=x
// GET api/<controller>/register?email=x&name=y
[HttpPost("register")]
[Authorize(Roles = RoleNames.Host)]
public async Task Register(string email)
public async Task Register(string email, string name)
{
await RegisterContact(email);
await RegisterContact(email, name);
}
public struct ClientAssembly