File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
FirebaseAuth/Sources/Swift Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -2382,7 +2382,16 @@ extension Auth: AuthInterop {
2382
2382
private let keychainServices : AuthKeychainServices
2383
2383
2384
2384
/// The user access (ID) token used last time for posting auth state changed notification.
2385
- private var lastNotifiedUserToken : String ?
2385
+ ///
2386
+ /// - Note: The atomic wrapper can be removed when the SDK is fully
2387
+ /// synchronized with structured concurrency.
2388
+ private var lastNotifiedUserToken : String ? {
2389
+ get { lastNotifiedUserTokenLock. withLock { _lastNotifiedUserToken } }
2390
+ set { lastNotifiedUserTokenLock. withLock { _lastNotifiedUserToken = newValue } }
2391
+ }
2392
+
2393
+ private var _lastNotifiedUserToken : String ?
2394
+ private var lastNotifiedUserTokenLock = NSLock ( )
2386
2395
2387
2396
/// This flag denotes whether or not tokens should be automatically refreshed.
2388
2397
/// Will only be set to `true` if the another Firebase service is included (additionally to
Original file line number Diff line number Diff line change @@ -125,8 +125,17 @@ class SecureTokenService: NSObject, NSSecureCoding {
125
125
///
126
126
/// This method is specifically for providing the access token to internal clients during
127
127
/// deserialization and sign-in events, and should not be used to retrieve the access token by
128
- /// anyone else.
129
- var accessToken : String
128
+ /// anyone else.
129
+ ///
130
+ /// - Note: The atomic wrapper can be removed when the SDK is fully
131
+ /// synchronized with structured concurrency.
132
+ var accessToken : String {
133
+ get { accessTokenLock. withLock { _accessToken } }
134
+ set { accessTokenLock. withLock { _accessToken = newValue } }
135
+ }
136
+
137
+ private var _accessToken : String
138
+ private let accessTokenLock = NSLock ( )
130
139
131
140
/// The refresh token for the user, or `nil` if the user has yet completed sign-in flow.
132
141
///
@@ -147,7 +156,7 @@ class SecureTokenService: NSObject, NSSecureCoding {
147
156
refreshToken: String ) {
148
157
internalService = SecureTokenServiceInternal ( )
149
158
self . requestConfiguration = requestConfiguration
150
- self . accessToken = accessToken
159
+ _accessToken = accessToken
151
160
self . accessTokenExpirationDate = accessTokenExpirationDate
152
161
self . refreshToken = refreshToken
153
162
}
You can’t perform that action at this time.
0 commit comments