plaid / plaid-link-ios

Plaid Link iOS SDK
https://plaid.com/docs/link/ios
MIT License
133 stars 88 forks source link

Misleading error for expired link_token #25

Open CorbinMontague opened 10 months ago

CorbinMontague commented 10 months ago

Please do not include your API secret or public_key in any issue.

A detailed description of the steps to reproduce the issue

  1. Make sure a redirect URI has been setup as a Universal Link in your aasa file and registered in the Plaid Dashboard following docs here
  2. Create a link_token following the docs here
  3. Let the link_token expire
  4. From one of the iOS Plaid sample apps included in this repository (I used LinkDemo-SwiftUI) , use the expired link_token to create a LinkTokenConfiguration instance for calling Plaid.create()
  5. Run the sample app and click on Open Plaid Link
  6. Notice an error screen is rendered (see screenshot below) and an error is returned that indicates a redirect URI must be configured in the developer dashboard which is not indicative of the true issue (an expired link_token)

What you expected to see?

An error that mentions the link_token is expired

What you saw instead?

An error that mentions a redirect URI has not been configured in the Plaid dashboard:

exit with ExitError(errorCode: LinkKit.ExitErrorCode.invalidRequest(INVALID_FIELD), errorMessage: "OAuth redirect URI must be configured in the developer dashboard. See https://plaid.com/docs/#oauth-redirect-uris", displayMessage: Optional(""), errorJSON: Optional("{\n  \"display_message\": null,\n  \"documentation_url\": \"https://plaid.com/docs/?ref=error#invalid-request-errors\",\n  \"error_code\": \"INVALID_FIELD\",\n  \"error_message\": \"OAuth redirect URI must be configured in the developer dashboard. See https://plaid.com/docs/#oauth-redirect-uris\",\n  \"error_type\": \"INVALID_REQUEST\",\n  \"request_id\": \"9o4dbGVjPNSp8lD\",\n  \"suggested_action\": null\n}"))
ExitMetadata(status: Optional(), institution: Optional(LinkKit.Institution(id: "", name: "")), linkSessionID: Optional(""), requestID: Optional(""), metadataJSON: nil)
Screenshots that show the state of the UI (if applicable) expiredTokenError

When submitting an issue for Plaid Link iOS please include the following information:

Name Value
Link env Sandbox
LinkKit version 4.6.5
iOS version 17.0
iOS device iPhone 15 simulator

List of used 3rd party libraries (e.g. CocoaPods):

dtroupe-plaid commented 10 months ago

I was unable to reproduce this issue using an expired token. Was this in anyway possibly related to issue 24. Can you confirm you are still experiencing this issue?

CorbinMontague commented 10 months ago

@dtroupe-plaid I do still see this issue today using one of my auth or identity link tokens that recently expired with the Plaid sample app