File tree Expand file tree Collapse file tree 7 files changed +7
-23
lines changed
FirebaseAppleSwiftUI/Sources/Services
FirebaseAuthSwiftUI/Sources/Services
FirebaseFacebookSwiftUI/Sources/Services
FirebaseGoogleSwiftUI/Sources/Services
FirebaseOAuthSwiftUI/Sources/Services Expand file tree Collapse file tree 7 files changed +7
-23
lines changed Original file line number Diff line number Diff line change @@ -14,16 +14,14 @@ protocol AppleOperationReauthentication {
1414}
1515
1616extension 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 }
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ protocol EmailPasswordOperationReauthentication {
2121
2222extension 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 }
Original file line number Diff line number Diff 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
3429public protocol AuthenticatedOperation {
3530 func callAsFunction( on user: User ) async throws
36- func reauthenticate( ) async throws -> AuthenticationToken
31+ func reauthenticate( ) async throws
3732}
3833
3934public extension AuthenticatedOperation {
Original file line number Diff line number Diff line change @@ -28,16 +28,14 @@ protocol FacebookOperationReauthentication {
2828}
2929
3030extension 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 }
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ protocol GoogleOperationReauthentication {
3535}
3636
3737extension 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 }
Original file line number Diff line number Diff line change @@ -14,16 +14,14 @@ protocol OAuthOperationReauthentication {
1414}
1515
1616extension 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 }
Original file line number Diff line number Diff line change @@ -14,16 +14,14 @@ protocol TwitterOperationReauthentication {
1414}
1515
1616extension 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 }
You can’t perform that action at this time.
0 commit comments