Fixed secret retrieval for connection testing while adding an ERI data source (#325)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2025-03-11 13:57:47 +01:00
1 parent 0125f48f61
commit 2429788ccc
10 files changed
+53 -40

No files matched your search

@@ -98,7 +98,7 @@ public partial class DataSourceERI_V1InfoDialog : ComponentBase, IAsyncDisposabl
return;
}
var loginResult = await client.AuthenticateAsync(this.DataSource, this.RustService);
var loginResult = await client.AuthenticateAsync(this.RustService);
if (!loginResult.Successful)
{
this.dataIssues.Add(loginResult.Message);
@@ -188,14 +188,8 @@ public partial class DataSourceERI_V1Dialog : ComponentBase, ISecretId
try
{
var cts = new CancellationTokenSource(TimeSpan.FromSeconds(14));
var dataSource = new DataSourceERI_V1
{
AuthMethod = this.dataAuthMethod,
Hostname = this.dataHostname,
Port = this.dataPort,
};
using var client = ERIClientFactory.Get(ERIVersion.V1, dataSource);
this.DataSource = this.CreateDataSource();
using var client = ERIClientFactory.Get(ERIVersion.V1, this.DataSource);
if(client is null)
{
await this.form.Validate();
@@ -217,7 +211,7 @@ public partial class DataSourceERI_V1Dialog : ComponentBase, ISecretId
this.availableAuthMethods = authSchemes.Data!.Select(n => n.AuthMethod).ToList();
var loginResult = await client.AuthenticateAsync(this.DataSource, this.RustService, cts.Token);
var loginResult = await client.AuthenticateAsync(this.RustService, this.dataSecret, cts.Token);
if (!loginResult.Successful)
{
await this.form.Validate();