Private
Public Access
1
0

Fix Plaid link token error handling and show user-visible errors

Validate Plaid credentials are configured before calling the API,
and validate the returned link token before passing it to Plaid
Link JS. Show error snackbars for all bank sync failures instead
of only logging to console.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-08 16:29:16 -05:00
parent 6e80bcf98b
commit 849a392d14
2 changed files with 31 additions and 9 deletions
@@ -43,6 +43,10 @@ public class PlaidSyncProvider : IAccountSyncProvider
public async Task<PlaidLinkTokenResult> CreateLinkTokenAsync(string userId)
{
if (string.IsNullOrEmpty(_config.ClientId) || string.IsNullOrEmpty(_config.Secret))
throw new InvalidOperationException(
"Plaid credentials are not configured. Set BankSync:Plaid:ClientId and BankSync:Plaid:Secret in appsettings.json.");
var response = await _client.LinkTokenCreateAsync(new LinkTokenCreateRequest
{
ClientId = _config.ClientId,