[Front-end] Fixed login.js to reroute properly