Moved login logic from cart to app