File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -235,11 +235,33 @@ public final class User {
235235 // }
236236
237237 public func delete( completion: ( ( Error ? ) -> Void ) ? ) {
238- fatalError ( " \( #function) not yet implemented " )
238+ deleteImpl ( ) { error in
239+ if let completion {
240+ DispatchQueue . main. async {
241+ completion ( error)
242+ }
243+ }
244+ }
239245 }
240246
241247 public func delete( ) async throws {
242- fatalError ( " \( #function) not yet implemented " )
248+ try await withCheckedThrowingContinuation { ( continuation: CheckedContinuation < Void , any Error > ) in
249+ deleteImpl ( ) { error in
250+ if let error {
251+ continuation. resume ( throwing: error)
252+ } else {
253+ continuation. resume ( )
254+ }
255+ }
256+ }
257+ }
258+
259+ private func deleteImpl( completion: @escaping ( Error ? ) -> Void ) {
260+ let future = swift_firebase. swift_cxx_shims. firebase. auth. user_delete ( impl)
261+ future. setCompletion ( {
262+ let ( _, error) = future. resultAndError { AuthErrorCode ( $0) }
263+ completion ( error)
264+ } )
243265 }
244266
245267 public func sendEmailVerification( beforeUpdatingEmail email: String ) async throws {
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ user_reload(::firebase::auth::User user) {
5252 user.Reload ());
5353}
5454
55+ inline ::swift_firebase::swift_cxx_shims::firebase::VoidFuture
56+ user_delete (::firebase::auth::User user) {
57+ return ::swift_firebase::swift_cxx_shims::firebase::VoidFuture::From (
58+ user.Delete ());
59+ }
60+
5561inline ::swift_firebase::swift_cxx_shims::firebase::Future<
5662 ::firebase::auth::AuthResult>
5763user_reauthenticate_and_retrieve_data (
You can’t perform that action at this time.
0 commit comments