Adds functioning code for proper login failure redirect