Skip to content

Commit

Permalink
[auth-swift] Remove erroneously added public api (#12094)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 authored Nov 10, 2023
1 parent 66c970a commit 3b1e6fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FirebaseAuth/Sources/Swift/Auth/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ extension Auth: AuthInterop {
return false
}

#if os(iOS)
#if os(iOS) && !targetEnvironment(macCatalyst)
/** @fn initializeRecaptchaConfigWithCompletion:completion:
@brief Initializes reCAPTCHA using the settings configured for the project or
tenant.
Expand Down
4 changes: 2 additions & 2 deletions FirebaseAuth/Sources/Swift/User/User.swift
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,9 @@ extension User: NSSecureCoding {}
@remarks See `AuthErrors` for a list of error codes that are common to all API methods.
*/
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
public func getIDToken(forcingRefresh forceRefresh: Bool = false) async throws -> String {
public func getIDToken() async throws -> String {
return try await withCheckedThrowingContinuation { continuation in
self.getIDTokenForcingRefresh(forceRefresh) { tokenResult, error in
self.getIDTokenForcingRefresh(false) { tokenResult, error in
if let tokenResult {
continuation.resume(returning: tokenResult)
} else if let error {
Expand Down
15 changes: 9 additions & 6 deletions FirebaseAuth/Tests/Unit/SwiftAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class AuthAPI_hOnlyTests: XCTestCase {
#endif
}

func FIRAuth_h() throws {
func FIRAuth_h(credential: AuthCredential) throws {
let auth = FirebaseAuth.Auth.auth()
let authApp = FirebaseAuth.Auth.auth(app: FirebaseApp.app()!)
let user = auth.currentUser!
Expand Down Expand Up @@ -155,8 +155,10 @@ class AuthAPI_hOnlyTests: XCTestCase {
_ = auth.canHandle(URL(fileURLWithPath: "/my/path"))
auth.setAPNSToken(Data(), type: AuthAPNSTokenType(rawValue: 2)!)
_ = auth.canHandleNotification([:])
auth.initializeRecaptchaConfig { _ in
}
#if !targetEnvironment(macCatalyst)
auth.initializeRecaptchaConfig { _ in
}
#endif
#endif
auth.revokeToken(withAuthorizationCode: "A")
try auth.useUserAccessGroup("abc")
Expand All @@ -180,9 +182,11 @@ class AuthAPI_hOnlyTests: XCTestCase {
let provider = OAuthProvider(providerID: "abc")
#if os(iOS)
let credential = try await provider.credential(with: nil)
_ = try await auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil)
_ = try await auth.signIn(with: credential)
try await auth.initializeRecaptchaConfig()
_ = try await auth.signIn(with: OAuthProvider(providerID: "abc"), uiDelegate: nil)
#if !targetEnvironment(macCatalyst)
try await auth.initializeRecaptchaConfig()
#endif
#endif
_ = try await auth.signInAnonymously()
_ = try await auth.signIn(withCustomToken: "abc")
Expand Down Expand Up @@ -655,7 +659,6 @@ class AuthAPI_hOnlyTests: XCTestCase {
_ = try await user.getIDTokenResult()
_ = try await user.getIDTokenResult(forcingRefresh: true)
_ = try await user.getIDToken()
_ = try await user.getIDToken(forcingRefresh: false)
_ = try await user.link(with: credential)
_ = try await user.unlink(fromProvider: "abc")
try await user.sendEmailVerification()
Expand Down

0 comments on commit 3b1e6fe

Please sign in to comment.