Skip to content

Commit

Permalink
Fix binary packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmichel committed Jan 7, 2024
1 parent 5e0420b commit 2d8c882
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
10 changes: 5 additions & 5 deletions Sources/Auth/Storage/KeychainLocalStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
import Foundation
@preconcurrency import KeychainAccess

struct KeychainLocalStorage: AuthLocalStorage {
public struct KeychainLocalStorage: AuthLocalStorage {
private let keychain: Keychain

init(service: String, accessGroup: String?) {
public init(service: String, accessGroup: String?) {
if let accessGroup {
keychain = Keychain(service: service, accessGroup: accessGroup)
} else {
keychain = Keychain(service: service)
}
}

func store(key: String, value: Data) throws {
public func store(key: String, value: Data) throws {
try keychain.set(value, key: key)
}

func retrieve(key: String) throws -> Data? {
public func retrieve(key: String) throws -> Data? {
try keychain.getData(key)
}

func remove(key: String) throws {
public func remove(key: String) throws {
try keychain.remove(key)
}
}
Expand Down
15 changes: 0 additions & 15 deletions Sources/Auth/Storage/LocalStorageEngines.swift

This file was deleted.

4 changes: 2 additions & 2 deletions Sources/Supabase/SupabaseClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public final class SupabaseClient: @unchecked Sendable {
public convenience init(
supabaseURL: String,
supabaseKey: String,
options: SupabaseClientOptions = .init(auth: .init(storage: LocalStorageEngines.keychain))
options: SupabaseClientOptions = .init(auth: .init(storage: KeychainLocalStorage(service: "supabase.gotrue.swift", accessGroup: nil)))
) {
guard let supabaseURL = URL(string: supabaseURL) else {
fatalError("Invalid supabaseURL: \(supabaseURL)")
Expand All @@ -142,7 +142,7 @@ public final class SupabaseClient: @unchecked Sendable {
public convenience init(
supabaseURL: String,
supabaseKey: String,
options: SupabaseClientOptions = .init(auth: .init(storage: LocalStorageEngines.wincred))
options: SupabaseClientOptions = .init(auth: .init(storage: WinCredLocalStorage(service: "supabase.gotrue.swift")))
) {
guard let supabaseURL = URL(string: supabaseURL) else {
fatalError("Invalid supabaseURL: \(supabaseURL)")
Expand Down

0 comments on commit 2d8c882

Please sign in to comment.