Fix Styling for kanban board, removed encrpytion for gmail as it was affecting connection

This commit is contained in:
cesnimda
2026-03-21 20:03:50 +01:00
parent 793ed6eb65
commit 2b0e86f0ac
6 changed files with 54 additions and 26 deletions
+10 -1
View File
@@ -1,6 +1,7 @@
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Security.Cryptography;
using JobTrackerApi.Data;
using JobTrackerApi.Models;
using Microsoft.AspNetCore.DataProtection;
@@ -230,7 +231,15 @@ public sealed class GmailOAuthService : IGmailOAuthService
return _protector.Unprotect(connection.EncryptedAccessToken);
}
var refreshToken = _protector.Unprotect(connection.EncryptedRefreshToken);
string refreshToken;
try
{
refreshToken = _protector.Unprotect(connection.EncryptedRefreshToken);
}
catch (CryptographicException)
{
throw new InvalidOperationException("Your stored Gmail connection can no longer be decrypted after a server key change. Disconnect Gmail and connect it again.");
}
var refreshed = await RefreshAccessTokenAsync(refreshToken, cancellationToken);
var accessToken = refreshed.access_token?.Trim();
if (string.IsNullOrWhiteSpace(accessToken))