Fix login

I think this fixes all the login issues. Somebody(s) should test it and confirm my pull request. Maybe @jschoeff81690 or @JohnBarton27?