File tree Expand file tree Collapse file tree 8 files changed +11
-19
lines changed Expand file tree Collapse file tree 8 files changed +11
-19
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public actor AuthClient {
34
34
url: URL ,
35
35
headers: [ String : String ] = [ : ] ,
36
36
flowType: AuthFlowType = Configuration . defaultFlowType,
37
- localStorage: AuthLocalStorage = Configuration . defaultLocalStorage ,
37
+ localStorage: AuthLocalStorage ,
38
38
encoder: JSONEncoder = AuthClient . Configuration. jsonEncoder,
39
39
decoder: JSONDecoder = AuthClient . Configuration. jsonDecoder,
40
40
fetch: @escaping FetchHandler = { try await URLSession . shared. data ( for: $0) }
@@ -101,7 +101,7 @@ public actor AuthClient {
101
101
url: URL ,
102
102
headers: [ String : String ] = [ : ] ,
103
103
flowType: AuthFlowType = AuthClient . Configuration. defaultFlowType,
104
- localStorage: AuthLocalStorage = AuthClient . Configuration . defaultLocalStorage ,
104
+ localStorage: AuthLocalStorage ,
105
105
encoder: JSONEncoder = AuthClient . Configuration. jsonEncoder,
106
106
decoder: JSONDecoder = AuthClient . Configuration. jsonDecoder,
107
107
fetch: @escaping FetchHandler = { try await URLSession . shared. data ( for: $0) }
Original file line number Diff line number Diff line change @@ -62,10 +62,4 @@ extension AuthClient.Configuration {
62
62
63
63
/// The default ``AuthFlowType`` used when initializing a ``AuthClient`` instance.
64
64
public static let defaultFlowType : AuthFlowType = . pkce
65
-
66
- /// The default ``AuthLocalStorage`` instance used by the ``AuthClient``.
67
- public static let defaultLocalStorage : AuthLocalStorage = KeychainLocalStorage (
68
- service: " supabase.gotrue.swift " ,
69
- accessGroup: nil
70
- )
71
65
}
Original file line number Diff line number Diff line change 1
1
import Foundation
2
2
3
- public protocol GoTrueLocalStorage : Sendable {
3
+ public protocol AuthLocalStorage : Sendable {
4
4
func store( key: String , value: Data ) throws
5
5
func retrieve( key: String ) throws -> Data ?
6
6
func remove( key: String ) throws
Original file line number Diff line number Diff line change 2
2
import Foundation
3
3
@preconcurrency import KeychainAccess
4
4
5
- struct KeychainLocalStorage : GoTrueLocalStorage {
5
+ struct KeychainLocalStorage : AuthLocalStorage {
6
6
private let keychain : Keychain
7
7
8
8
init ( service: String , accessGroup: String ? ) {
@@ -25,4 +25,4 @@ struct KeychainLocalStorage: GoTrueLocalStorage {
25
25
try keychain. remove ( key)
26
26
}
27
27
}
28
- #endif
28
+ #endif
Original file line number Diff line number Diff line change @@ -2,14 +2,14 @@ import Foundation
2
2
3
3
public enum LocalStorageEngines {
4
4
#if os(iOS) || os(macOS) || os(watchOS) || os(tvOS)
5
- public static let keychain : some GoTrueLocalStorage = {
5
+ public static let keychain : some AuthLocalStorage = {
6
6
KeychainLocalStorage ( service: " supabase.gotrue.swift " , accessGroup: nil )
7
7
} ( )
8
8
#endif
9
9
10
10
#if os(Windows)
11
- public static let wincred : some GoTrueLocalStorage = {
11
+ public static let wincred : some AuthLocalStorage = {
12
12
WinCredLocalStorage ( service: " supabase.gotrue.swift " )
13
13
} ( )
14
14
#endif
15
- }
15
+ }
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ enum WinCredLocalStorageError: Error {
7
7
case other( Int )
8
8
}
9
9
10
- public struct WinCredLocalStorage : GoTrueLocalStorage {
10
+ public struct WinCredLocalStorage : AuthLocalStorage {
11
11
private let service : String
12
12
13
13
private let credentialType : DWORD
@@ -79,4 +79,4 @@ public struct WinCredLocalStorage: GoTrueLocalStorage {
79
79
}
80
80
}
81
81
}
82
- #endif
82
+ #endif
Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ import Foundation
5
5
import FoundationNetworking
6
6
#endif
7
7
8
- let version = _Helpers. version
9
-
10
8
/// PostgREST client.
11
9
public actor PostgrestClient {
12
10
public typealias FetchHandler = @Sendable ( _ request: URLRequest ) async throws -> (
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public struct SupabaseClientOptions: Sendable {
48
48
public let decoder : JSONDecoder
49
49
50
50
public init (
51
- storage: AuthLocalStorage = AuthClient . Configuration . defaultLocalStorage ,
51
+ storage: AuthLocalStorage ,
52
52
flowType: AuthFlowType = AuthClient . Configuration. defaultFlowType,
53
53
encoder: JSONEncoder = AuthClient . Configuration. jsonEncoder,
54
54
decoder: JSONDecoder = AuthClient . Configuration. jsonDecoder
You can’t perform that action at this time.
0 commit comments