diff --git a/Oqtane.Client/Services/InstallationService.cs b/Oqtane.Client/Services/InstallationService.cs
index e7fdce81..f1fbd057 100644
--- a/Oqtane.Client/Services/InstallationService.cs
+++ b/Oqtane.Client/Services/InstallationService.cs
@@ -56,10 +56,5 @@ namespace Oqtane.Services
{
await PostAsync($"{ApiUrl}/restart");
}
-
- public async Task RegisterAsync(string email, string name)
- {
- await PostJsonAsync($"{ApiUrl}/register?email={WebUtility.UrlEncode(email)}&name={WebUtility.UrlEncode(name)}", true);
- }
}
}
diff --git a/Oqtane.Client/Services/Interfaces/IInstallationService.cs b/Oqtane.Client/Services/Interfaces/IInstallationService.cs
index 8f5853c8..e8a433c7 100644
--- a/Oqtane.Client/Services/Interfaces/IInstallationService.cs
+++ b/Oqtane.Client/Services/Interfaces/IInstallationService.cs
@@ -34,14 +34,5 @@ namespace Oqtane.Services
///
///
internal status/message object
Task RestartAsync();
-
- ///
- /// Registers a new
- ///
- ///
Email of the user to be registered
- ///
Name of the user to be registered
- ///
- Task RegisterAsync(string email, string name);
-
}
}
diff --git a/Oqtane.Server/Controllers/InstallationController.cs b/Oqtane.Server/Controllers/InstallationController.cs
index 48ddd513..48bbf8b8 100644
--- a/Oqtane.Server/Controllers/InstallationController.cs
+++ b/Oqtane.Server/Controllers/InstallationController.cs
@@ -62,7 +62,7 @@ namespace Oqtane.Controllers
if (installation.Success)
{
- await RegisterContact(config.HostEmail, config.HostName);
+ await RegisterContact(config.HostEmail, config.HostName, config.Register);
}
}
else
@@ -257,7 +257,7 @@ namespace Oqtane.Controllers
}
}
- private async Task RegisterContact(string email, string name)
+ private async Task RegisterContact(string email, string name, bool register)
{
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)}&name={WebUtility.UrlEncode(name)}")).ConfigureAwait(false);
+ var response = await client.GetAsync(new Uri(url + $"/api/registry/contact/?id={_configManager.GetInstallationId()}&email={WebUtility.UrlEncode(email)}&name={WebUtility.UrlEncode(name)}®ister={register.ToString().ToLower()}")).ConfigureAwait(false);
}
}
}
@@ -278,14 +278,6 @@ namespace Oqtane.Controllers
}
}
- // GET api/
/register?email=x&name=y
- [HttpPost("register")]
- [Authorize(Roles = RoleNames.Host)]
- public async Task Register(string email, string name)
- {
- await RegisterContact(email, name);
- }
-
public struct ClientAssembly
{
public ClientAssembly(string filepath, bool hashfilename)