Skip to content

Commit e2f1c9c

Browse files
authored
[#247] 회원 탈퇴 후 뷰가 LoginView로 돌아가지 않는 이슈를 해결한다 (#250)
* fix: 로그인 로직과 회원탈퇴 로직 분리 * refactor: 기존에 존재한 변수로 처리하도록 수정
1 parent 061f365 commit e2f1c9c

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

DevLog/Infra/Service/SocialLogin/AppleAuthenticationService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ final class AppleAuthenticationService: AuthenticationService {
110110

111111
_ = try await deleteFunction.call(["uid": uid])
112112

113-
try await signOut(uid)
114113
try await user?.delete()
114+
try await messaging.deleteToken()
115+
try Auth.auth().signOut()
115116
}
116117

117118
func link(uid: String, email: String) async throws {

DevLog/Infra/Service/SocialLogin/GithubAuthenticationService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ final class GithubAuthenticationService: NSObject, AuthenticationService {
8787

8888
_ = try await deleteFunction.call(["uid": uid])
8989

90-
try await signOut(uid)
9190
try await user?.delete()
91+
try await messaging.deleteToken()
92+
try Auth.auth().signOut()
9293
}
9394

9495
func link(uid: String, email: String) async throws {

DevLog/Infra/Service/SocialLogin/GoogleAuthenticationService.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,11 @@ final class GoogleAuthenticationService: AuthenticationService {
8282

8383
_ = try await deleteFunction.call(["uid": uid])
8484

85-
try await signOut(uid)
86-
try await Auth.auth().currentUser?.delete()
85+
try await user?.delete()
86+
GIDSignIn.sharedInstance.signOut()
87+
try await GIDSignIn.sharedInstance.disconnect()
88+
try await messaging.deleteToken()
89+
try Auth.auth().signOut()
8790
}
8891

8992
func link(uid: String, email: String) async throws {

DevLog/Presentation/ViewModel/SettingViewModel.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ final class SettingViewModel: Store {
108108
send(.setAlert(isPresented: false))
109109
send(.setLoading(true))
110110
try await deleteAuthuseCase.execute()
111+
sessionUseCase.execute(false)
111112
} catch {
112113
send(.setAlert(isPresented: true, type: .error))
113114
}

0 commit comments

Comments
 (0)