Skip to content

Commit c26a802

Browse files
docs
1 parent 1ae38a2 commit c26a802

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

Auth0/CredentialsManager.swift

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ import LocalAuthentication
2525
/// - ``CredentialsManagerError``
2626
/// - <doc:RefreshTokens>
2727
public struct CredentialsManager: Sendable {
28-
28+
29+
// storage is inherently sendable as it uses Keychain under the hood and is stateless
2930
private let sendableStorage: SendableBox<CredentialsStorage>
31+
3032
private var storage: CredentialsStorage {
3133
sendableStorage.value
3234
}
33-
34-
struct SendableBox<T>: @unchecked Sendable {
35-
let value: T
36-
}
3735

3836
private let storeKey: String
3937
private let authentication: Authentication

Auth0/Shared.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,9 @@ func extractRedirectURL(from url: URL) -> URL? {
3030

3131
return nil
3232
}
33+
34+
/// Wrapper for non-Sendable types that need to be used in Sendable contexts.
35+
/// Use only when thread-safety is guaranteed through synchronization (locks, serial queues, etc.).
36+
struct SendableBox<T>: @unchecked Sendable {
37+
let value: T
38+
}

0 commit comments

Comments
 (0)