Making post login js generic.