Skip to content

Commit 54bdba6

Browse files
committed
refactor: 기존에 존재한 변수로 처리하도록 수정
1 parent 96e8a26 commit 54bdba6

3 files changed

Lines changed: 3 additions & 15 deletions

File tree

DevLog/Infra/Service/SocialLogin/AppleAuthenticationService.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ final class AppleAuthenticationService: AuthenticationService {
102102
}
103103

104104
func deleteAuth(_ uid: String) async throws {
105-
guard let currentUser = Auth.auth().currentUser else {
106-
throw AuthError.notAuthenticated
107-
}
108-
109105
let token = try await refreshAppleAccessToken()
110106

111107
try await revokeAppleAccessToken(token: token)
@@ -114,7 +110,7 @@ final class AppleAuthenticationService: AuthenticationService {
114110

115111
_ = try await deleteFunction.call(["uid": uid])
116112

117-
try await currentUser.delete()
113+
try await user?.delete()
118114
try await messaging.deleteToken()
119115
try Auth.auth().signOut()
120116
}

DevLog/Infra/Service/SocialLogin/GithubAuthenticationService.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,13 @@ final class GithubAuthenticationService: NSObject, AuthenticationService {
8181
}
8282

8383
func deleteAuth(_ uid: String) async throws {
84-
guard let currentUser = Auth.auth().currentUser else {
85-
throw AuthError.notAuthenticated
86-
}
87-
8884
try await revokeAccessToken()
8985

9086
let deleteFunction = functions.httpsCallable("deleteUserFirestoreData")
9187

9288
_ = try await deleteFunction.call(["uid": uid])
9389

94-
try await currentUser.delete()
90+
try await user?.delete()
9591
try await messaging.deleteToken()
9692
try Auth.auth().signOut()
9793
}

DevLog/Infra/Service/SocialLogin/GoogleAuthenticationService.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,11 @@ final class GoogleAuthenticationService: AuthenticationService {
7878
}
7979

8080
func deleteAuth(_ uid: String) async throws {
81-
guard let currentUser = Auth.auth().currentUser else {
82-
throw AuthError.notAuthenticated
83-
}
84-
8581
let deleteFunction = functions.httpsCallable("deleteUserFirestoreData")
8682

8783
_ = try await deleteFunction.call(["uid": uid])
8884

89-
try await currentUser.delete()
85+
try await user?.delete()
9086
GIDSignIn.sharedInstance.signOut()
9187
try await GIDSignIn.sharedInstance.disconnect()
9288
try await messaging.deleteToken()

0 commit comments

Comments
 (0)