           switch result {
           case let .success(user):
             isPresentingSheet = user?.isEmailVerified ?? false
-          case .failure:
+          case let .failure(error):
             isPresentingSheet = false
+            alertItem = AlertItem(
+              title: "An authentication error occurred.",
+              message: error.localizedDescription
+            )
           }
         }
       }
     }
     .sheet(isPresented: $isPresentingSheet) {
       SuccessView(email: email)
+    }
+    .alert(item: $alertItem) { alert -> Alert in
+      Alert(
+        title: Text(alert.title),
+        message: Text(alert.message)
+      )
     }
   }
 

struct ContentView: View {
  @State private var email: String = ""
  @State private var isPresentingSheet = false

  var body: some View {
    NavigationView {

      }
    }
  }
}

/// Model object for an `Alert` view.
struct AlertItem: Identifiable {
  var id = UUID()
  var title: String
  var message: String
}

/// A custom styled TextField with an SF symbol icon.
