Fixed login function (hopefully)

I had some problems in loginModel.js line 86. I tried to return loginModel but that didn't work so I addded it to the window space. I don't know if that is the right thing to do.