Skip to content

Commit 81f0c99

Browse files
committed
refactor: providerIDs가 currentUser가 nil인 경우 빈 배열을 반환하도록 개선
1 parent 5d155e2 commit 81f0c99

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

DevLog/Data/Repository/AuthDataRepositoryImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ final class AuthDataRepositoryImpl: AuthDataRepository {
3333
}
3434

3535
func fetchAllProviders() async throws -> [AuthProvider] {
36-
let providerStrings = authService.providerIDs ?? []
36+
let providerStrings = authService.providerIDs
3737
return providerStrings.compactMap { AuthProvider(rawValue: $0) }
3838
}
3939

DevLog/Data/Repository/AuthenticationRepositoryImpl.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class AuthenticationRepositoryImpl: AuthenticationRepository {
6767
throw AuthError.notAuthenticated
6868
}
6969

70-
let providers = (authService.providerIDs ?? []).compactMap { AuthProvider(rawValue: $0) }
70+
let providers = authService.providerIDs.compactMap { AuthProvider(rawValue: $0) }
7171

7272
for provider in providers {
7373
switch provider {

DevLog/Infra/Service/AuthService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ final class AuthService {
2020
Auth.auth().currentUser?.uid
2121
}
2222

23-
var providerIDs: [String]? {
24-
Auth.auth().currentUser?.providerData.map { $0.providerID }
23+
var providerIDs: [String] {
24+
Auth.auth().currentUser?.providerData.map { $0.providerID } ?? []
2525
}
2626

2727
func getProviderID() async throws -> String? {

0 commit comments

Comments
 (0)