plaid / pattern

An example end-to-end Plaid integration to create items and fetch transaction data
MIT License
445 stars 223 forks source link

removes automatic generation of link tokens #190

Closed lindawoo-plaid closed 2 years ago

lindawoo-plaid commented 2 years ago

Fixes link token create flow so that createLinkToken is only called when a user clicks "add a bank" and not before. Otherwise link tokens may expire before the user launches link: 1) removes use effect on pages to automatically generate link token 2) generates new link token only onClick 3) LinkButton component no longer renders anything on page, but just opens Link automatically whenever a link token is present. 4) in onSuccess callback, deletes link token in context so that link does not automatically open upon rendering of page.