File tree 2 files changed +30
-2
lines changed 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 {
235
235
// }
236
236
237
237
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
+ }
239
245
}
240
246
241
247
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
+ } )
243
265
}
244
266
245
267
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) {
52
52
user.Reload ());
53
53
}
54
54
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
+
55
61
inline ::swift_firebase::swift_cxx_shims::firebase::Future<
56
62
::firebase::auth::AuthResult>
57
63
user_reauthenticate_and_retrieve_data (
You can’t perform that action at this time.
0 commit comments