Fix login redirect bug.