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