Made the OAuth a Popout to work with Org

This commit is contained in:
Jamie 2018-08-18 23:04:48 +01:00
parent c4b21c5f77
commit b6645c8b58
5 changed files with 30 additions and 30 deletions

View file

@ -217,15 +217,11 @@ namespace Ombi.Api.Plex
return await Api.Request<OAuthPin>(request);
}
public async Task<Uri> GetOAuthUrl(int pinId, string code, string applicationUrl, bool wizard)
public async Task<Uri> GetOAuthUrl(int pinId, string code, string applicationUrl)
{
var request = new Request("auth#", "https://app.plex.tv", HttpMethod.Get);
await AddHeaders(request);
var forwardUrl = wizard
? new Request($"Wizard/OAuth/{pinId}", applicationUrl, HttpMethod.Get)
: new Request($"Login/OAuth/{pinId}", applicationUrl, HttpMethod.Get);
request.AddQueryString("forwardUrl", forwardUrl.FullUri.ToString());
request.AddQueryString("pinID", pinId.ToString());
request.AddQueryString("code", code);
request.AddQueryString("context[device][product]", ApplicationName);