Skip to content

Commit 6ecea25

Browse files
authored
[Auth] Mark *Credential classes as Sendable (#14100)
1 parent 0672366 commit 6ecea25

10 files changed

+17
-10
lines changed

FirebaseAuth/Sources/Swift/AuthProvider/AuthCredential.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616

1717
/// Public representation of a credential.
1818
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
19-
@objc(FIRAuthCredential) open class AuthCredential: NSObject {
19+
@objc(FIRAuthCredential) open class AuthCredential: NSObject, @unchecked Sendable {
2020
/// The name of the identity provider for the credential.
2121
@objc public let provider: String
2222

FirebaseAuth/Sources/Swift/AuthProvider/EmailAuthProvider.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ import Foundation
3838
}
3939

4040
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
41-
@objc(FIREmailPasswordAuthCredential) class EmailAuthCredential: AuthCredential, NSSecureCoding {
41+
@objc(FIREmailPasswordAuthCredential) class EmailAuthCredential: AuthCredential, NSSecureCoding,
42+
@unchecked Sendable {
4243
let email: String
4344

4445
enum EmailType {

FirebaseAuth/Sources/Swift/AuthProvider/FacebookAuthProvider.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import Foundation
3434
}
3535

3636
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
37-
@objc(FIRFacebookAuthCredential) class FacebookAuthCredential: AuthCredential, NSSecureCoding {
37+
@objc(FIRFacebookAuthCredential) class FacebookAuthCredential: AuthCredential, NSSecureCoding,
38+
@unchecked Sendable {
3839
let accessToken: String
3940

4041
init(withAccessToken accessToken: String) {

FirebaseAuth/Sources/Swift/AuthProvider/GameCenterAuthProvider.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129

130130
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
131131
@objc(FIRGameCenterAuthCredential)
132-
class GameCenterAuthCredential: AuthCredential, NSSecureCoding {
132+
class GameCenterAuthCredential: AuthCredential, NSSecureCoding, @unchecked Sendable {
133133
let playerID: String
134134
let teamPlayerID: String?
135135
let gamePlayerID: String?

FirebaseAuth/Sources/Swift/AuthProvider/GitHubAuthProvider.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ import Foundation
3434
}
3535

3636
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
37-
@objc(FIRGitHubAuthCredential) class GitHubAuthCredential: AuthCredential, NSSecureCoding {
37+
@objc(FIRGitHubAuthCredential) class GitHubAuthCredential: AuthCredential, NSSecureCoding,
38+
@unchecked Sendable {
3839
let token: String
3940

4041
init(withToken token: String) {

FirebaseAuth/Sources/Swift/AuthProvider/GoogleAuthProvider.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ import Foundation
3636
}
3737

3838
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
39-
@objc(FIRGoogleAuthCredential) class GoogleAuthCredential: AuthCredential, NSSecureCoding {
39+
@objc(FIRGoogleAuthCredential) class GoogleAuthCredential: AuthCredential, NSSecureCoding,
40+
@unchecked Sendable {
4041
let idToken: String
4142
let accessToken: String
4243

FirebaseAuth/Sources/Swift/AuthProvider/OAuthCredential.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import Foundation
1616

1717
/// Internal implementation of `AuthCredential` for generic credentials.
1818
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
19-
@objc(FIROAuthCredential) open class OAuthCredential: AuthCredential, NSSecureCoding {
19+
@objc(FIROAuthCredential) open class OAuthCredential: AuthCredential, NSSecureCoding,
20+
@unchecked Sendable {
2021
/// The ID Token associated with this credential.
2122
@objc(IDToken) public let idToken: String?
2223

FirebaseAuth/Sources/Swift/AuthProvider/PhoneAuthCredential.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import Foundation
1818
///
1919
/// This class is available on iOS only.
2020
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
21-
@objc(FIRPhoneAuthCredential) open class PhoneAuthCredential: AuthCredential, NSSecureCoding {
21+
@objc(FIRPhoneAuthCredential) open class PhoneAuthCredential: AuthCredential, NSSecureCoding,
22+
@unchecked Sendable {
2223
enum CredentialKind {
2324
case phoneNumber(_ phoneNumber: String, _ temporaryProof: String)
2425
case verification(_ id: String, _ code: String)

FirebaseAuth/Sources/Swift/AuthProvider/TwitterAuthProvider.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import Foundation
3535
}
3636

3737
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
38-
@objc(FIRTwitterAuthCredential) class TwitterAuthCredential: AuthCredential, NSSecureCoding {
38+
@objc(FIRTwitterAuthCredential) class TwitterAuthCredential: AuthCredential, NSSecureCoding,
39+
@unchecked Sendable {
3940
let token: String
4041
let secret: String
4142

FirebaseAuth/Sources/Swift/Utilities/AuthRecaptchaVerifier.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
}
4545

4646
@available(iOS 13, tvOS 13, macOS 10.15, macCatalyst 13, watchOS 7, *)
47-
class AuthRecaptchaVerifier {
47+
class AuthRecaptchaVerifier: @unchecked Sendable {
4848
private(set) weak var auth: Auth?
4949
private(set) var agentConfig: AuthRecaptchaConfig?
5050
private(set) var tenantConfigs: [String: AuthRecaptchaConfig] = [:]

0 commit comments

Comments
 (0)