From 17cdbef376dab8b033c98aefdd000b675fa61535 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 14 Mar 2018 11:12:50 -0400 Subject: [PATCH] encode username and password when sending login POST from ui fixes #1553 --- .../src/login/authenticationServices/authentication.service.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/awx/ui/client/src/login/authenticationServices/authentication.service.js b/awx/ui/client/src/login/authenticationServices/authentication.service.js index addeab821e..6285d8d43c 100644 --- a/awx/ui/client/src/login/authenticationServices/authentication.service.js +++ b/awx/ui/client/src/login/authenticationServices/authentication.service.js @@ -49,11 +49,10 @@ export default return getCSRFToken.then(function({data}) { var csrfmiddlewaretoken = /name='csrfmiddlewaretoken' value='([0-9a-zA-Z]+)' \//.exec(data)[1]; - // TODO: data needs to be encoded return $http({ method: 'POST', url: `/api/login/`, - data: `username=${username}&password=${password}&csrfmiddlewaretoken=${csrfmiddlewaretoken}&next=%2fapi%2f`, + data: `username=${encodeURIComponent(username)}&password=${encodeURIComponent(password)}&csrfmiddlewaretoken=${csrfmiddlewaretoken}&next=%2fapi%2f`, headers: { 'Content-Type': 'application/x-www-form-urlencoded' }