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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user