Skip to content

Commit ad1f667

Browse files
Merge pull request #1283 from firebase/remove-authentication-token
2 parents e643d78 + cbed04a commit ad1f667

File tree

7 files changed

+7
-23
lines changed

7 files changed

+7
-23
lines changed

FirebaseSwiftUI/FirebaseAppleSwiftUI/Sources/Services/AccountService+Apple.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ protocol AppleOperationReauthentication {
1414
}
1515

1616
extension AppleOperationReauthentication {
17-
@MainActor func reauthenticate() async throws -> AuthenticationToken {
17+
@MainActor func reauthenticate() async throws {
1818
guard let user = Auth.auth().currentUser else {
1919
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
2020
}
2121

2222
do {
2323
let credential = try await appleProvider.createAuthCredential()
2424
try await user.reauthenticate(with: credential)
25-
26-
return .firebase("")
2725
} catch {
2826
throw AuthServiceError.signInFailed(underlying: error)
2927
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AccountService+Email.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ protocol EmailPasswordOperationReauthentication {
2121

2222
extension EmailPasswordOperationReauthentication {
2323
// TODO: - @MainActor because User is non-sendable. Might change this once User is sendable in firebase-ios-sdk
24-
@MainActor func reauthenticate() async throws -> AuthenticationToken {
24+
@MainActor func reauthenticate() async throws {
2525
guard let user = Auth.auth().currentUser else {
2626
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
2727
}
@@ -35,8 +35,6 @@ extension EmailPasswordOperationReauthentication {
3535

3636
let credential = EmailAuthProvider.credential(withEmail: email, password: password)
3737
try await Auth.auth().currentUser?.reauthenticate(with: credential)
38-
39-
return .firebase("")
4038
} catch {
4139
throw AuthServiceError.signInFailed(underlying: error)
4240
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AccountService.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@ extension NSError {
2525
}
2626
}
2727

28-
public enum AuthenticationToken {
29-
case apple(ASAuthorizationAppleIDCredential, String)
30-
case firebase(String)
31-
}
32-
3328
@MainActor
3429
public protocol AuthenticatedOperation {
3530
func callAsFunction(on user: User) async throws
36-
func reauthenticate() async throws -> AuthenticationToken
31+
func reauthenticate() async throws
3732
}
3833

3934
public extension AuthenticatedOperation {

FirebaseSwiftUI/FirebaseFacebookSwiftUI/Sources/Services/AccountService+Facebook.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,14 @@ protocol FacebookOperationReauthentication {
2828
}
2929

3030
extension FacebookOperationReauthentication {
31-
@MainActor func reauthenticate() async throws -> AuthenticationToken {
31+
@MainActor func reauthenticate() async throws {
3232
guard let user = Auth.auth().currentUser else {
3333
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
3434
}
3535

3636
do {
3737
let credential = try await facebookProvider.createAuthCredential()
3838
try await user.reauthenticate(with: credential)
39-
40-
return .firebase("")
4139
} catch {
4240
throw AuthServiceError.signInFailed(underlying: error)
4341
}

FirebaseSwiftUI/FirebaseGoogleSwiftUI/Sources/Services/AccountService+Google.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ protocol GoogleOperationReauthentication {
3535
}
3636

3737
extension GoogleOperationReauthentication {
38-
@MainActor func reauthenticate() async throws -> AuthenticationToken {
38+
@MainActor func reauthenticate() async throws {
3939
guard let user = Auth.auth().currentUser else {
4040
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
4141
}
@@ -44,7 +44,6 @@ extension GoogleOperationReauthentication {
4444
let credential = try await googleProvider.createAuthCredential()
4545
try await user.reauthenticate(with: credential)
4646

47-
return .firebase("")
4847
} catch {
4948
throw AuthServiceError.signInFailed(underlying: error)
5049
}

FirebaseSwiftUI/FirebaseOAuthSwiftUI/Sources/Services/AccountService+OAuth.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ protocol OAuthOperationReauthentication {
1414
}
1515

1616
extension OAuthOperationReauthentication {
17-
@MainActor func reauthenticate() async throws -> AuthenticationToken {
17+
@MainActor func reauthenticate() async throws {
1818
guard let user = Auth.auth().currentUser else {
1919
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
2020
}
2121

2222
do {
2323
let credential = try await oauthProvider.createAuthCredential()
2424
try await user.reauthenticate(with: credential)
25-
26-
return .firebase("")
2725
} catch {
2826
throw AuthServiceError.signInFailed(underlying: error)
2927
}

FirebaseSwiftUI/FirebaseTwitterSwiftUI/Sources/Services/AccountService+Twitter.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,14 @@ protocol TwitterOperationReauthentication {
1414
}
1515

1616
extension TwitterOperationReauthentication {
17-
@MainActor func reauthenticate() async throws -> AuthenticationToken {
17+
@MainActor func reauthenticate() async throws {
1818
guard let user = Auth.auth().currentUser else {
1919
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
2020
}
2121

2222
do {
2323
let credential = try await twitterProvider.createAuthCredential()
2424
try await user.reauthenticate(with: credential)
25-
26-
return .firebase("")
2725
} catch {
2826
throw AuthServiceError.signInFailed(underlying: error)
2927
}

0 commit comments

Comments
 (0)