Skip to content

Commit 124b5ea

Browse files
committed
[Auth] Eliminate possibility of multiple AuthBackendRPCImplementation instances
1 parent 82febdd commit 124b5ea

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

FirebaseAuth/Sources/Swift/Backend/AuthBackend.swift

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,16 @@ class AuthBackend {
7676
return "FirebaseAuth.iOS/\(FirebaseVersion()) \(GTMFetcherStandardUserAgentString(nil))"
7777
}
7878

79-
private static var gBackendImplementation: AuthBackendImplementation?
79+
private static var gBackendImplementation = AuthBackendRPCImplementation()
8080

8181
class func setDefaultBackendImplementationWithRPCIssuer(issuer: AuthBackendRPCIssuer?) {
82-
let defaultImplementation = AuthBackendRPCImplementation()
8382
if let issuer = issuer {
84-
defaultImplementation.rpcIssuer = issuer
83+
gBackendImplementation.rpcIssuer = issuer
8584
}
86-
gBackendImplementation = defaultImplementation
8785
}
8886

8987
class func implementation() -> AuthBackendImplementation {
90-
if gBackendImplementation == nil {
91-
gBackendImplementation = AuthBackendRPCImplementation()
92-
}
93-
return gBackendImplementation!
88+
return gBackendImplementation
9489
}
9590

9691
class func call<T: AuthRPCRequest>(with request: T) async throws -> T.Response {

0 commit comments

Comments
 (0)