Drop unused polar refresh-token column

This commit is contained in:
Marc-André Bombeck committed 2026-06-14 21:23:56 +02:00
1 parent ccf4d6b2ad
commit 2d5b15c067
4 files changed
+1 -6

No files matched your search

@@ -40,8 +40,6 @@ ALTER TABLE "users"
-- ── 3. users — Polar OAuth credentials (encrypted at app level) ────────
ALTER TABLE "users"
ADD COLUMN IF NOT EXISTS "polar_access_token_encrypted" TEXT;
ALTER TABLE "users"
ADD COLUMN IF NOT EXISTS "polar_refresh_token_encrypted" TEXT;
ALTER TABLE "users"
ADD COLUMN IF NOT EXISTS "polar_user_id_encrypted" TEXT;
-1
View File
@@ -126,7 +126,6 @@ model User {
// product, so each self-hoster registers their own Polar app and the OAuth
// tokens are stored encrypted.
polarAccessTokenEncrypted String? @map("polar_access_token_encrypted")
polarRefreshTokenEncrypted String? @map("polar_refresh_token_encrypted")
polarUserIdEncrypted String? @map("polar_user_id_encrypted")
// v1.17.0 — Oura OAuth credentials (F4, per-user, encrypted at app level).
+1 -2
View File
@@ -94,8 +94,7 @@ export const GET = apiHandler(async (request: NextRequest) => {
where: { id: userId },
data: {
polarAccessTokenEncrypted: encrypt(tokens.access_token),
// Polar issues no refresh token; the column stays null.
polarRefreshTokenEncrypted: null,
// Polar issues no refresh token, so no refresh column is stored.
polarUserIdEncrypted: encrypt(polarUserId),
},
});
-1
View File
@@ -36,7 +36,6 @@ export const POST = apiHandler(async () => {
where: { id: user.id },
data: {
polarAccessTokenEncrypted: null,
polarRefreshTokenEncrypted: null,
polarUserIdEncrypted: null,
},
});