Xero API - how do I re-authenticate programatically?

I have an app that connects to the Xero API upon loading. But I want the user to be able to "disconnect" from the API (i.e. DELETE connection with Xero), so that the user can reconnect with another Xero organisation. The "disconnect" part is easy - just send a DELETE api call to the xero connections endpoint. But how do I then re-authenticate the user (which automatically takes them through selecting the Xero organisation on the Xero side)?

In other words, I'd like to programatically do exactly what this button does in edit mode:

By the way, thanks to this solution that helped me create a custom auth flow to connect to Xero! Encountered an error: CSRF DETECTED - #6 by jclutterbuck

Hey @maxamillian! Have you explored using an Auth Login component? Currently, Retool only supports re-triggering an auth flow by manually clicking a button though there has been a request to be able to trigger it programmatically.

The Auth Login component is exactly what I need! I didn't know it existed. I had created a work-around, but this is much cleaner. Thank you!