Update FreeNAS.pm - correction of the check whether the auth token should be used

This commit is contained in:
Alexander 2025-07-02 10:55:26 +02:00 committed by GitHub
parent 29b110f5e2
commit 32371ca5fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -344,7 +344,7 @@ sub freenas_api_connect {
}
$freenas_server_list->{$apihost}->setHost($scheme . '://' . $apihost);
$freenas_server_list->{$apihost}->addHeader('Content-Type', 'application/json');
if (defined($scfg->{'truenas_token_auth'})) {
if (defined($scfg->{'truenas_token_auth'}) && $scfg->{'truenas_token_auth'}) {
syslog("info", (caller(0))[3] . " : Authentication using Bearer Token Auth");
$freenas_server_list->{$apihost}->addHeader('Authorization', 'Bearer ' . $scfg->{truenas_secret});
} else {