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 {
23822382 private let keychainServices : AuthKeychainServices
23832383
23842384 /// 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 ( )
23862395
23872396 /// This flag denotes whether or not tokens should be automatically refreshed.
23882397 /// 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 {
125125 ///
126126 /// This method is specifically for providing the access token to internal clients during
127127 /// 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 ( )
130139
131140 /// The refresh token for the user, or `nil` if the user has yet completed sign-in flow.
132141 ///
@@ -147,7 +156,7 @@ class SecureTokenService: NSObject, NSSecureCoding {
147156 refreshToken: String ) {
148157 internalService = SecureTokenServiceInternal ( )
149158 self . requestConfiguration = requestConfiguration
150- self . accessToken = accessToken
159+ _accessToken = accessToken
151160 self . accessTokenExpirationDate = accessTokenExpirationDate
152161 self . refreshToken = refreshToken
153162 }
You can’t perform that action at this time.
0 commit comments