diff --git a/Sources/Auth/Storage/AuthLocalStorage.swift b/Sources/Auth/Storage/AuthLocalStorage.swift index 4af21d31..02852f3f 100644 --- a/Sources/Auth/Storage/AuthLocalStorage.swift +++ b/Sources/Auth/Storage/AuthLocalStorage.swift @@ -8,12 +8,8 @@ public protocol AuthLocalStorage: Sendable { extension AuthClient.Configuration { #if !os(Linux) && !os(Windows) - public static let defaultLocalStorage: any AuthLocalStorage = KeychainLocalStorage( - service: "supabase.gotrue.swift", - accessGroup: nil - ) + public static let defaultLocalStorage: any AuthLocalStorage = KeychainLocalStorage() #elseif os(Windows) - public static let defaultLocalStorage: any AuthLocalStorage = - WinCredLocalStorage(service: "supabase.gotrue.swift") + public static let defaultLocalStorage: any AuthLocalStorage = WinCredLocalStorage() #endif } diff --git a/Sources/Auth/Storage/KeychainLocalStorage.swift b/Sources/Auth/Storage/KeychainLocalStorage.swift index 38bd8fbb..a2453bd3 100644 --- a/Sources/Auth/Storage/KeychainLocalStorage.swift +++ b/Sources/Auth/Storage/KeychainLocalStorage.swift @@ -1,10 +1,11 @@ #if !os(Windows) && !os(Linux) import Foundation + /// ``AuthLocalStorage`` implementation using Keychain. This is the default local storage used by the library. public struct KeychainLocalStorage: AuthLocalStorage { private let keychain: Keychain - public init(service: String, accessGroup: String?) { + public init(service: String = "supabase.gotrue.swift", accessGroup: String? = nil) { keychain = Keychain(service: service, accessGroup: accessGroup) } diff --git a/Sources/Auth/Storage/WinCredLocalStorage.swift b/Sources/Auth/Storage/WinCredLocalStorage.swift index 3eee5841..d132fb7a 100644 --- a/Sources/Auth/Storage/WinCredLocalStorage.swift +++ b/Sources/Auth/Storage/WinCredLocalStorage.swift @@ -13,7 +13,7 @@ private let credentialType: DWORD private let credentialPersistence: DWORD - public init(service: String) { + public init(service: String = "supabase.gotrue.swift") { self.service = service credentialType = DWORD(CRED_TYPE_GENERIC) credentialPersistence = DWORD(CRED_PERSIST_LOCAL_MACHINE)