Updated JS to be a bit more dynamic and responsive to login failures