From 5e50a8fed708360a1f49e3185e8c0d45ebbb45c8 Mon Sep 17 00:00:00 2001 From: cesnimda Date: Sat, 21 Mar 2026 20:24:53 +0100 Subject: [PATCH] Handle Stale access token for Gmail and update the startup schema repair. Style the kanban for darkmode better --- JobTrackerApi/Program.cs | 2 ++ JobTrackerApi/Services/GmailOAuthService.cs | 10 +++++++++- job-tracker-ui/src/components/KanbanBoard.tsx | 14 +++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/JobTrackerApi/Program.cs b/JobTrackerApi/Program.cs index c4ecc85..90134e4 100644 --- a/JobTrackerApi/Program.cs +++ b/JobTrackerApi/Program.cs @@ -537,6 +537,8 @@ CREATE TABLE IF NOT EXISTS "GmailConnections" ( // Ensure ownership columns exist even on non-legacy DBs. EnsureColumn(conn, "Companies", "OwnerUserId", "ALTER TABLE Companies ADD COLUMN OwnerUserId TEXT NULL;"); EnsureColumn(conn, "JobApplications", "OwnerUserId", "ALTER TABLE JobApplications ADD COLUMN OwnerUserId TEXT NULL;"); + EnsureColumn(conn, "Correspondences", "Subject", "ALTER TABLE Correspondences ADD COLUMN Subject TEXT NULL;"); + EnsureColumn(conn, "Correspondences", "Channel", "ALTER TABLE Correspondences ADD COLUMN Channel TEXT NULL;"); EnsureColumn(conn, "Correspondences", "ExternalMessageId", "ALTER TABLE Correspondences ADD COLUMN ExternalMessageId TEXT NULL;"); // Ensure data folder exists before creating/opening SQLite files. diff --git a/JobTrackerApi/Services/GmailOAuthService.cs b/JobTrackerApi/Services/GmailOAuthService.cs index 87bd27b..61995ad 100644 --- a/JobTrackerApi/Services/GmailOAuthService.cs +++ b/JobTrackerApi/Services/GmailOAuthService.cs @@ -228,7 +228,15 @@ public sealed class GmailOAuthService : IGmailOAuthService connection.AccessTokenExpiresAt is { } expiresAt && expiresAt > DateTimeOffset.UtcNow.AddMinutes(1)) { - return _protector.Unprotect(connection.EncryptedAccessToken); + try + { + return _protector.Unprotect(connection.EncryptedAccessToken); + } + catch (CryptographicException) + { + connection.EncryptedAccessToken = null; + connection.AccessTokenExpiresAt = null; + } } string refreshToken; diff --git a/job-tracker-ui/src/components/KanbanBoard.tsx b/job-tracker-ui/src/components/KanbanBoard.tsx index 1223c7c..eb4bfe0 100644 --- a/job-tracker-ui/src/components/KanbanBoard.tsx +++ b/job-tracker-ui/src/components/KanbanBoard.tsx @@ -131,19 +131,19 @@ export default function KanbanBoard() { cursor: "grab", borderRadius: 3, border: `1px solid ${alpha(c, theme.palette.mode === "dark" ? 0.22 : 0.14)}`, - background: theme.palette.mode === "dark" ? "#f8fafc" : "rgba(255,255,255,0.96)", + background: theme.palette.mode === "dark" ? "rgba(15,23,42,0.82)" : "rgba(255,255,255,0.96)", backdropFilter: "blur(8px)", - color: "#0f172a", + color: theme.palette.mode === "dark" ? "#e5eefc" : "#0f172a", }} > - + {j.company?.name ?? ""} { e.stopPropagation(); setMenuJobId(j.id); @@ -153,12 +153,12 @@ export default function KanbanBoard() { - + {j.jobTitle} - - {j.location ? : null} + + {j.location ? : null}