Fix for "white screen" on failed login

from burningrooftop pull request.