fixing login

I noticed the login wasnt working. the http call worked with poster, so
I knew it had to be the javascript. Guesswork lead to this fix.