Fix Styling for kanban board, removed encrpytion for gmail as it was affecting connection
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user