Skip to content

Commit 344e7e0

Browse files
committed
Fix Self-Service API key input prompt during install wizard, even if key is set
Fixes #52
1 parent 72dc4c0 commit 344e7e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/core/icingaagent/misc/Start-IcingaAgentDirectorWizard.psm1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,16 @@ function Start-IcingaAgentDirectorWizard()
3333
}
3434

3535
if ($ForceTemplateKey -eq $FALSE) {
36-
$SelfServiceAPIKey = $LocalAPIKey;
37-
if ([string]::IsNullOrEmpty($SelfServiceAPIKey)) {
36+
if ([string]::IsNullOrEmpty($LocalAPIKey)) {
3837
$LegacyTokenPath = Join-Path -Path Get-IcingaAgentConfigDirectory -ChildPath 'icingadirector.token';
3938
if (Test-Path $LegacyTokenPath) {
4039
$SelfServiceAPIKey = Get-Content -Path $LegacyTokenPath;
4140
Set-IcingaPowerShellConfig -Path 'IcingaDirector.SelfService.ApiKey' -Value $SelfServiceAPIKey;
41+
} else {
42+
$ForceTemplateKey = $TRUE;
4243
}
44+
} else {
45+
$SelfServiceAPIKey = $LocalAPIKey;
4346
}
4447
}
4548

0 commit comments

Comments
 (0)