Start of Login logic.