Skip to content

Commit af67832

Browse files
chore: add default to userId in PowerSyncCredentials (#22)
1 parent 72dd7e1 commit af67832

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

Demo/PowerSyncExample/PowerSync/SupabaseConnector.swift

+4-5
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,14 @@ class SupabaseConnector: PowerSyncBackendConnector {
7070

7171
override func fetchCredentials() async throws -> PowerSyncCredentials? {
7272
session = try await client.auth.session
73-
73+
7474
if (self.session == nil) {
7575
throw AuthError.sessionMissing
7676
}
77-
77+
7878
let token = session!.accessToken
79-
80-
// userId is for debugging purposes only
81-
return PowerSyncCredentials(endpoint: self.powerSyncEndpoint, token: token, userId: currentUserID)
79+
80+
return PowerSyncCredentials(endpoint: self.powerSyncEndpoint, token: token)
8281
}
8382

8483
override func uploadData(database: PowerSyncDatabaseProtocol) async throws {

Sources/PowerSync/PowerSyncCredentials.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public struct PowerSyncCredentials: Codable {
1414
/// User ID.
1515
public let userId: String?
1616

17-
public init(endpoint: String, token: String, userId: String?) {
17+
public init(endpoint: String, token: String, userId: String? = nil) {
1818
self.endpoint = endpoint
1919
self.token = token
2020
self.userId = userId

0 commit comments

Comments
 (0)