mirror of
https://github.com/ansible/awx.git
synced 2024-11-01 16:51:11 +03:00
encode username and password when sending login POST from ui
fixes #1553
This commit is contained in:
parent
5c0a52df16
commit
17cdbef376
@ -49,11 +49,10 @@ export default
|
|||||||
|
|
||||||
return getCSRFToken.then(function({data}) {
|
return getCSRFToken.then(function({data}) {
|
||||||
var csrfmiddlewaretoken = /name='csrfmiddlewaretoken' value='([0-9a-zA-Z]+)' \//.exec(data)[1];
|
var csrfmiddlewaretoken = /name='csrfmiddlewaretoken' value='([0-9a-zA-Z]+)' \//.exec(data)[1];
|
||||||
// TODO: data needs to be encoded
|
|
||||||
return $http({
|
return $http({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `/api/login/`,
|
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: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user