Hey homakov, nice work. might want to remember to encodeURIComponent() around the keys as well:
SecureLogin = function(scope){
function toQuery(obj){
return Object.keys(obj).reduce(function(a,k){a.push(k+'='+encodeURIComponent(obj[k]));return a},[]).join('&')