https://linen.dev logo
Handling auth dropoffs
# 🖥│support-forum
r
Hey all, quick question around
connectedAccounts.initiate
. I get that calling initiate creates a connected account immediately - that makes sense so we can check connection status while the user is mid-OAuth. That said, I’m running into a bit of a DX issue: If the user drops off after I redirect them to the
redirectUrl
, and I later try to call initiate again, I get an error that the user already has a connected account. But at that point, I can’t recover the redirectUrl unless I’d saved it myself somewhere which adds extra complexity on my end. Would be super helpful if: initiate were idempotent (e.g. returned the existing connection + redirectUrl if one’s already in progress), or there was a way to retrieve the
redirectUrl
from the existing connection if it hasn’t completed yet. Is there a recommended pattern for handling dropoffs gracefully? thanks
c
Hi Kristen, You can’t retrieve the redirectUrl by retrieving connected account information. However, you can refresh your connected account, which will provide you with the redirectUrl as payload.
r
thanks for the response Uday, how do you refresh the connected account? is that via api?
r
thank you!