The event should come after the logic as per the developer guidelines. If the event comes before the logic, it should be called beforeLogin. In this case, beforeLogin doesn't make sense, so just move the event after the parent::afterLogin call.