Skip to content

Commit 4ae9684

Browse files
authored
[Auth] Ignore concurrency warnings for global vars made for testing (#14101)
1 parent 2b10cab commit 4ae9684

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

FirebaseAuth/Sources/Swift/Backend/IdentityToolkitRequest.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ private let kHttpProtocol = "http:"
1919

2020
private let kEmulatorHostAndPrefixFormat = "%@/%@"
2121

22-
private var gAPIHost = "www.googleapis.com"
22+
#if compiler(>=6)
23+
/// Host for server API calls. This should be changed via
24+
/// `IdentityToolkitRequest.setHost(_ host:)` for testing purposes only.
25+
private nonisolated(unsafe) var gAPIHost = "www.googleapis.com"
26+
#else
27+
/// Host for server API calls. This should be changed via
28+
/// `IdentityToolkitRequest.setHost(_ host:)` for testing purposes only.
29+
private var gAPIHost = "www.googleapis.com"
30+
#endif // compiler(>=6)
2331

2432
private let kFirebaseAuthAPIHost = "www.googleapis.com"
2533
private let kIdentityPlatformAPIHost = "identitytoolkit.googleapis.com"

FirebaseAuth/Sources/Swift/Backend/RPC/SecureTokenRequest.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,15 @@ private let kRefreshTokenKey = "refreshToken"
5454
/// The key for the "code" parameter in the request.
5555
private let kCodeKey = "code"
5656

57-
/// Host for server API calls.
58-
private var gAPIHost = "securetoken.googleapis.com"
57+
#if compiler(>=6)
58+
/// Host for server API calls. This should be changed via
59+
/// `SecureTokenRequest.setHost(_ host:)` for testing purposes only.
60+
private nonisolated(unsafe) var gAPIHost = "securetoken.googleapis.com"
61+
#else
62+
/// Host for server API calls. This should be changed via
63+
/// `SecureTokenRequest.setHost(_ host:)` for testing purposes only.
64+
private var gAPIHost = "securetoken.googleapis.com"
65+
#endif // compiler(>=6)
5966

6067
/// Represents the parameters for the token endpoint.
6168
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)

0 commit comments

Comments
 (0)