Persist auth across preview rerenders

This commit is contained in:
lucast committed 2026-10-07 02:14:28 +02:00
1 parent d6b35fe346
commit d9a996aa98
5 files changed
+163 -8

No files matched your search

+3 -1
View File
@@ -27,7 +27,9 @@ public struct MusicAPI: Sendable {
try await client.request("POST", path: "auth/session")
}
public func signOut() async throws -> SignOutResponse {
try await client.request("POST", path: "auth/signout")
let response: SignOutResponse = try await client.request("POST", path: "auth/signout")
AuthCookiePersistence.clear()
return response
}
public func currentUser() async throws -> User { try await client.request("GET", path: "user") }