Skip to content

Commit

Permalink
[Auth] Revert unintentional commits on main (#14108)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored Nov 13, 2024
1 parent 87925ed commit 709a685
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 44 deletions.
37 changes: 16 additions & 21 deletions FirebaseAuth/Sources/Swift/Auth/Auth.swift
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ extension Auth: AuthInterop {
/// - user: The user object to be set as the current user of the calling Auth instance.
/// - completion: Optionally; a block invoked after the user of the calling Auth instance has
/// been updated or an error was encountered.
@objc open func updateCurrentUser(_ user: User?,
completion: (@Sendable (Error?) -> Void)? = nil) {
@objc open func updateCurrentUser(_ user: User?, completion: ((Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
guard let user else {
let error = AuthErrorUtils.nullUserError(message: nil)
Expand Down Expand Up @@ -287,7 +286,7 @@ extension Auth: AuthInterop {
)
#endif // !FIREBASE_CI
@objc open func fetchSignInMethods(forEmail email: String,
completion: (@Sendable ([String]?, Error?) -> Void)? = nil) {
completion: (([String]?, Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let request = CreateAuthURIRequest(identifier: email,
continueURI: "http://www.google.com/",
Expand Down Expand Up @@ -351,7 +350,7 @@ extension Auth: AuthInterop {
/// or is canceled. Invoked asynchronously on the main thread in the future.
@objc open func signIn(withEmail email: String,
password: String,
completion: (@Sendable (AuthDataResult?, Error?) -> Void)? = nil) {
completion: ((AuthDataResult?, Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let decoratedCallback = self.signInFlowAuthDataResultCallback(byDecorating: completion)
Task {
Expand Down Expand Up @@ -450,7 +449,7 @@ extension Auth: AuthInterop {
/// or is canceled. Invoked asynchronously on the main thread in the future.
@objc open func signIn(withEmail email: String,
link: String,
completion: (@Sendable (AuthDataResult?, Error?) -> Void)? = nil) {
completion: ((AuthDataResult?, Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let decoratedCallback = self.signInFlowAuthDataResultCallback(byDecorating: completion)
let credential = EmailAuthCredential(withEmail: email, link: link)
Expand Down Expand Up @@ -529,7 +528,7 @@ extension Auth: AuthInterop {
@objc(signInWithProvider:UIDelegate:completion:)
open func signIn(with provider: FederatedAuthProvider,
uiDelegate: AuthUIDelegate?,
completion: (@Sendable (AuthDataResult?, Error?) -> Void)?) {
completion: ((AuthDataResult?, Error?) -> Void)?) {
kAuthGlobalWorkQueue.async {
Task {
let decoratedCallback = self.signInFlowAuthDataResultCallback(byDecorating: completion)
Expand Down Expand Up @@ -630,7 +629,7 @@ extension Auth: AuthInterop {
/// or is canceled. Invoked asynchronously on the main thread in the future.
@objc(signInWithCredential:completion:)
open func signIn(with credential: AuthCredential,
completion: (@Sendable (AuthDataResult?, Error?) -> Void)? = nil) {
completion: ((AuthDataResult?, Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let decoratedCallback = self.signInFlowAuthDataResultCallback(byDecorating: completion)
Task {
Expand Down Expand Up @@ -700,8 +699,7 @@ extension Auth: AuthInterop {
/// not enabled. Enable them in the Auth section of the Firebase console.
/// - Parameter completion: Optionally; a block which is invoked when the sign in finishes, or is
/// canceled. Invoked asynchronously on the main thread in the future.
@objc open func signInAnonymously(completion: (@Sendable (AuthDataResult?, Error?) -> Void)? =
nil) {
@objc open func signInAnonymously(completion: ((AuthDataResult?, Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let decoratedCallback = self.signInFlowAuthDataResultCallback(byDecorating: completion)
if let currentUser = self.currentUser, currentUser.isAnonymous {
Expand Down Expand Up @@ -767,7 +765,7 @@ extension Auth: AuthInterop {
/// - Parameter completion: Optionally; a block which is invoked when the sign in finishes, or is
/// canceled. Invoked asynchronously on the main thread in the future.
@objc open func signIn(withCustomToken token: String,
completion: (@Sendable (AuthDataResult?, Error?) -> Void)? = nil) {
completion: ((AuthDataResult?, Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let decoratedCallback = self.signInFlowAuthDataResultCallback(byDecorating: completion)
let request = VerifyCustomTokenRequest(token: token,
Expand Down Expand Up @@ -836,7 +834,7 @@ extension Auth: AuthInterop {
/// or is canceled. Invoked asynchronously on the main thread in the future.
@objc open func createUser(withEmail email: String,
password: String,
completion: (@Sendable (AuthDataResult?, Error?) -> Void)? = nil) {
completion: ((AuthDataResult?, Error?) -> Void)? = nil) {
guard password.count > 0 else {
if let completion {
completion(nil, AuthErrorUtils.weakPasswordError(serverResponseReason: "Missing password"))
Expand Down Expand Up @@ -949,7 +947,7 @@ extension Auth: AuthInterop {
/// - Parameter completion: Optionally; a block which is invoked when the request finishes.
/// Invoked asynchronously on the main thread in the future.
@objc open func confirmPasswordReset(withCode code: String, newPassword: String,
completion: @Sendable @escaping (Error?) -> Void) {
completion: @escaping (Error?) -> Void) {
kAuthGlobalWorkQueue.async {
let request = ResetPasswordRequest(oobCode: code,
newPassword: newPassword,
Expand Down Expand Up @@ -989,8 +987,7 @@ extension Auth: AuthInterop {
/// Invoked
/// asynchronously on the main thread in the future.
@objc open func checkActionCode(_ code: String,
completion: @Sendable @escaping (ActionCodeInfo?, Error?)
-> Void) {
completion: @escaping (ActionCodeInfo?, Error?) -> Void) {
kAuthGlobalWorkQueue.async {
let request = ResetPasswordRequest(oobCode: code,
newPassword: nil,
Expand Down Expand Up @@ -1035,8 +1032,7 @@ extension Auth: AuthInterop {
/// - Parameter completion: Optionally; a block which is invoked when the request finishes.
/// Invoked asynchronously on the main thread in the future.
@objc open func verifyPasswordResetCode(_ code: String,
completion: @Sendable @escaping (String?, Error?)
-> Void) {
completion: @escaping (String?, Error?) -> Void) {
checkActionCode(code) { info, error in
if let error {
completion(nil, error)
Expand Down Expand Up @@ -1069,8 +1065,7 @@ extension Auth: AuthInterop {
/// - Parameter code: The out of band code to be applied.
/// - Parameter completion: Optionally; a block which is invoked when the request finishes.
/// Invoked asynchronously on the main thread in the future.
@objc open func applyActionCode(_ code: String,
completion: @Sendable @escaping (Error?) -> Void) {
@objc open func applyActionCode(_ code: String, completion: @escaping (Error?) -> Void) {
kAuthGlobalWorkQueue.async {
let request = SetAccountInfoRequest(requestConfiguration: self.requestConfiguration)
request.oobCode = code
Expand Down Expand Up @@ -1115,7 +1110,7 @@ extension Auth: AuthInterop {
/// Invoked
/// asynchronously on the main thread in the future.
@objc open func sendPasswordReset(withEmail email: String,
completion: (@Sendable (Error?) -> Void)? = nil) {
completion: ((Error?) -> Void)? = nil) {
sendPasswordReset(withEmail: email, actionCodeSettings: nil, completion: completion)
}

Expand Down Expand Up @@ -1148,7 +1143,7 @@ extension Auth: AuthInterop {
/// Invoked asynchronously on the main thread in the future.
@objc open func sendPasswordReset(withEmail email: String,
actionCodeSettings: ActionCodeSettings?,
completion: (@Sendable (Error?) -> Void)? = nil) {
completion: ((Error?) -> Void)? = nil) {
kAuthGlobalWorkQueue.async {
let request = GetOOBConfirmationCodeRequest.passwordResetRequest(
email: email,
Expand Down Expand Up @@ -1217,7 +1212,7 @@ extension Auth: AuthInterop {
/// Invoked asynchronously on the main thread in the future.
@objc open func sendSignInLink(toEmail email: String,
actionCodeSettings: ActionCodeSettings,
completion: (@Sendable (Error?) -> Void)? = nil) {
completion: ((Error?) -> Void)? = nil) {
if !actionCodeSettings.handleCodeInApp {
fatalError("The handleCodeInApp flag in ActionCodeSettings must be true for Email-link " +
"Authentication.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ import Foundation
/// - Parameter completion: Optionally; a block which is invoked asynchronously on the main
/// thread when the mobile web flow is completed.
open func getCredentialWith(_ uiDelegate: AuthUIDelegate?,
completion: (@Sendable (AuthCredential?, Error?) -> Void)? = nil) {
completion: ((AuthCredential?, Error?) -> Void)? = nil) {
guard let urlTypes = auth.mainBundleUrlTypes,
AuthWebUtils.isCallbackSchemeRegistered(forCustomURLScheme: callbackScheme,
urlTypes: urlTypes) else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import Foundation
@objc(verifyPhoneNumber:UIDelegate:completion:)
open func verifyPhoneNumber(_ phoneNumber: String,
uiDelegate: AuthUIDelegate? = nil,
completion: (@Sendable (_: String?, _: Error?) -> Void)?) {
completion: ((_: String?, _: Error?) -> Void)?) {
verifyPhoneNumber(phoneNumber,
uiDelegate: uiDelegate,
multiFactorSession: nil,
Expand All @@ -71,7 +71,7 @@ import Foundation
open func verifyPhoneNumber(_ phoneNumber: String,
uiDelegate: AuthUIDelegate? = nil,
multiFactorSession: MultiFactorSession? = nil,
completion: (@Sendable (_: String?, _: Error?) -> Void)?) {
completion: ((_: String?, _: Error?) -> Void)?) {
guard AuthWebUtils.isCallbackSchemeRegistered(forCustomURLScheme: callbackScheme,
urlTypes: auth.mainBundleUrlTypes) else {
fatalError(
Expand Down Expand Up @@ -132,7 +132,7 @@ import Foundation
open func verifyPhoneNumber(with multiFactorInfo: PhoneMultiFactorInfo,
uiDelegate: AuthUIDelegate? = nil,
multiFactorSession: MultiFactorSession?,
completion: (@Sendable (_: String?, _: Error?) -> Void)?) {
completion: ((_: String?, _: Error?) -> Void)?) {
multiFactorSession?.multiFactorInfo = multiFactorInfo
verifyPhoneNumber(multiFactorInfo.phoneNumber,
uiDelegate: uiDelegate,
Expand Down
Loading

0 comments on commit 709a685

Please sign in to comment.