Reauthorization lets a user restore access to a previously linked account when the institution requires fresh authentication, multi-factor authentication, or another security step.
reauthorise() accepts the existing Mono account ID as a string.
It does not accept the short-lived auth code returned by initial linking, and it does not accept a separate reauth token.
Older examples may refer to a reauth token. In @mono.co/connect.js 2.2.0, the implemented signature is reauthorise(accountId: string).
Implement the flow
Create the Connect instance, initialize it with reauthorise(accountId), then open it from a user action.
Use reauthorise() in place of setup() for this widget instance. If both methods are called, the last call replaces the mounted widget configuration.
Where the account ID comes from
For a newly linked account:
onSuccess returns { code } in the browser.
- The browser sends the code to your backend.
- The backend calls the exchange-token endpoint with the Mono secret key.
- The response contains the account ID your application stores.
- A later reauthorization passes that stored account ID to
reauthorise().
The account ID may also be available through the Mono dashboard or current customer/account APIs. Your backend should return only the identifier needed by the browser flow; it must not expose the Mono secret key.
Handle validation errors
The SDK validates the accountId argument before mounting the widget.
The current SDK throws these errors:
Observe the result
Use onEvent to diagnose progress and onSuccess to handle completion.
Do not log MFA values, credentials, or identity fields.