Fixed the login problem

utilized window.location.href in an if statement to redirect