Changed post from view to window & removed unused code from login.js