Optimized, method for showing dialog to enter confirmation code