Why does the Connect Link flow ignore the connect token's success_redirect_uri with a custom OAuth client in Pipedream?

This topic was automatically generated from Slack. You can find the original thread here.

Hi, we’re getting a Connect bug: with a custom OAuth client (oauthAppId), the Connect Link flow ignores the connect token’s success_redirect_uri.

When a user connects an account via Connect Link using a custom OAuth client (oauthAppId), Pipedream does not redirect them to the connect token’s success_redirect_uri after a successful connection — they’re left on the Pipedream-hosted success page. With your managed/shared OAuth client (no oauthAppId), the exact same flow and token config redirects to success_redirect_uri correctly. The connection itself succeeds in both cases (CONNECTION_SUCCESS webhook fires, account is saved and usable); only the post-connect redirect is missing with a custom client.

Details in thread.

Setup:
• Flow: Connect Link (hosted), token minted server-side.
• SDK: @pipedream/sdk 2.4.5, environment = production.
• App: microsoft_onedrive
• Custom OAuth client: can share in DM (read-only Microsoft Graph scopes)
• Token mint: client.tokens.create({ externalUserId, allowedOrigins, successRedirectUri, webhookUri }) — successRedirectUri IS set on the token.
• We then send the user to the returned connectLinkUrl with &app=microsoft_onedrive&oauthAppId=xx appended.
Observed:

  1. With oauthAppId (custom client): after OAuth completes and the account connects, the user stays on the Pipedream success page. No redirect to successRedirectUri.
  2. Without oauthAppId (shared client), same token with successRedirectUri set: redirects correctly.
  3. We also tried passing success_redirect_uri as a query param on the connect link URL itself
    Expected: after a successful connection, redirect to the token’s success_redirect_uri regardless of whether a custom OAuth client (oauthAppId) or the shared client is used.

Repro (any app + custom client should reproduce):

  1. Create a custom OAuth client for an app (we used microsoft_onedrive).
  2. Mint a connect token with successRedirectUri set.
  3. Build the connect link and append &oauthAppId=.
  4. Complete the OAuth flow → stays on Pipedream’s success page, no redirect.
  5. Repeat 2-4 without oauthAppId (shared client) → redirects to successRedirectUri.
    Questions:
    • Is this a known limitation of custom OAuth clients with Connect Link?
    • Is there a setting on the custom client (or token) to enable the success redirect, or is it a bug?
    • Any recommended workaround meanwhile? (The URL param doesn’t work for us.)
    Happy to share more if useful.

Sounds like a bug, @U0ASSCRDDM2 lmk if you need help debugging.

Hi I will be taking a look at this
I sent you a DM, so you can share more information to better debug this