Refactored redirect to route after login