updates login redirect logic to be more inline with v7, less greedy which is better.