js to add redirect path to login links