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
9 changes: 4 additions & 5 deletions Demo/PowerSyncExample/PowerSync/SupabaseConnector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,14 @@ class SupabaseConnector: PowerSyncBackendConnector {

override func fetchCredentials() async throws -> PowerSyncCredentials? {
session = try await client.auth.session

if (self.session == nil) {
throw AuthError.sessionMissing
}

let token = session!.accessToken

// userId is for debugging purposes only
return PowerSyncCredentials(endpoint: self.powerSyncEndpoint, token: token, userId: currentUserID)

return PowerSyncCredentials(endpoint: self.powerSyncEndpoint, token: token)
}

override func uploadData(database: PowerSyncDatabaseProtocol) async throws {
Expand Down
2 changes: 1 addition & 1 deletion Sources/PowerSync/PowerSyncCredentials.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public struct PowerSyncCredentials: Codable {
/// User ID.
public let userId: String?

public init(endpoint: String, token: String, userId: String?) {
public init(endpoint: String, token: String, userId: String? = nil) {
self.endpoint = endpoint
self.token = token
self.userId = userId
Expand Down