From 79cfbb17688a083eee3caeb88403659fa23774df Mon Sep 17 00:00:00 2001 From: LukePulverenti Luke Pulverenti luke pulverenti Date: Thu, 6 Sep 2012 14:42:21 -0400 Subject: [PATCH] Move userId to post data --- MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs | 2 +- MediaBrowser.ApiInteraction/ApiClient.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs index 0905016c42..c0ee2ff0eb 100644 --- a/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs +++ b/MediaBrowser.Api/HttpHandlers/UserAuthenticationHandler.cs @@ -12,7 +12,7 @@ namespace MediaBrowser.Api.HttpHandlers { protected override async Task GetObjectToSerialize() { - Guid userId = Guid.Parse(QueryString["userid"]); + Guid userId = Guid.Parse(await GetFormValue("userId").ConfigureAwait(false)); User user = Kernel.Instance.Users.First(u => u.Id == userId); string password = await GetFormValue("password").ConfigureAwait(false); diff --git a/MediaBrowser.ApiInteraction/ApiClient.cs b/MediaBrowser.ApiInteraction/ApiClient.cs index 48f43e03be..f8c0dc761b 100644 --- a/MediaBrowser.ApiInteraction/ApiClient.cs +++ b/MediaBrowser.ApiInteraction/ApiClient.cs @@ -657,7 +657,9 @@ namespace MediaBrowser.ApiInteraction string url = ApiUrl + "/UserAuthentication?userId=" + userId; url += "&dataformat=" + SerializationFormat.ToString(); - HttpContent content = new StringContent("password=" + password, Encoding.UTF8, "application/x-www-form-urlencoded"); + string postContent = string.Format("userid={0}&password={1}", userId, password); + + HttpContent content = new StringContent(postContent, Encoding.UTF8, "application/x-www-form-urlencoded"); HttpResponseMessage msg = await HttpClient.PostAsync(url, content).ConfigureAwait(false);