1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-11 12:02:35 +02:00

Fixed: Ensure an API Key is set when starting Sonarr

Closes #1514
This commit is contained in:
Mark McDowall 2017-05-22 21:54:18 -07:00
parent 563b5ef017
commit 6bbe4ce066
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0

View File

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@ -142,7 +142,21 @@ public string BindAddress
public bool LaunchBrowser => GetValueBoolean("LaunchBrowser", true);
public string ApiKey => GetValue("ApiKey", GenerateApiKey());
public string ApiKey
{
get
{
var apiKey = GetValue("ApiKey", GenerateApiKey());
if (apiKey.IsNullOrWhiteSpace())
{
apiKey = GenerateApiKey();
SetValue("ApiKey", apiKey);
}
return apiKey;
}
}
public AuthenticationType AuthenticationMethod
{