Skip to content

Commit

Permalink
Merge branch 'main' into chore/make-execute-and-watchthrowable-in-swift
Browse files Browse the repository at this point in the history
  • Loading branch information
DominicGBauer authored Feb 13, 2025
2 parents 9e3aa61 + af67832 commit f6fafea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
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

0 comments on commit f6fafea

Please sign in to comment.