Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Sources/Auth/Storage/AuthLocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 2 additions & 1 deletion Sources/Auth/Storage/KeychainLocalStorage.swift
Original file line number Diff line number Diff line change
@@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion Sources/Auth/Storage/WinCredLocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down