Use the Application URL if we have it to fix #2201

This commit is contained in:
Jamie 2018-04-28 20:47:42 +01:00
commit 647a01ebb0

View file

@ -57,21 +57,8 @@ namespace Ombi.Core.Authentication
public async Task<Uri> GetOAuthUrl(int pinId, string code, string websiteAddress = null) public async Task<Uri> GetOAuthUrl(int pinId, string code, string websiteAddress = null)
{ {
Uri url; var settings = await _customizationSettingsService.GetSettingsAsync();
if (websiteAddress.IsNullOrEmpty()) var url = _api.GetOAuthUrl(pinId, code, settings.ApplicationUrl.IsNullOrEmpty() ? websiteAddress : settings.ApplicationUrl, false);
{
var settings = await _customizationSettingsService.GetSettingsAsync();
if (settings.ApplicationUrl.IsNullOrEmpty())
{
return null;
}
url = _api.GetOAuthUrl(pinId, code, settings.ApplicationUrl, false);
}
else
{
url = _api.GetOAuthUrl(pinId, code, websiteAddress, false);
}
return url; return url;
} }