refactor login check

fix some javascript issues for login check failures
fixes Graylog2/graylog2-web-interface#266