Reauthorization allows you to reconnect to an already authenticated account when additional verification is required. This is commonly needed when:Documentation Index
Fetch the complete documentation index at: https://sammydocs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Multi-Factor Authentication (MFA) is required
- Two-Factor Authentication (2FA) has been set up by the user
- Additional security verification is needed
- Previous connection has expired
Implementation
Instead of using the regularsetup() method, reauthorization uses the reauthorise() method:
The
reauthorise() method and setup() method should not be used together. When both are called, the last called method takes precedence.Complete Example
Event Handling
During reauthorization, you can monitor the process using theonEvent callback:
Error Handling
If a reauthorization token is not provided, the SDK will throw an error:Getting a Reauth Token
To obtain a reauth token:- Your backend should receive the initial auth code from successful account linking
- Exchange this for an account ID using Mono’s API
- When reauthorization is needed, use the account ID to generate a reauth token
- Pass this token to your frontend for use with
reauthorise()
Check Mono’s API documentation for details on obtaining reauth tokens.
Best Practices
-
Token Management
- Store reauth tokens securely
- Generate new tokens only when needed
- Don’t reuse old tokens
-
Error Handling
- Always handle potential errors during reauthorization
- Provide clear feedback to users
- Have a fallback for failed reauthorization attempts
-
User Experience
- Clearly communicate why reauthorization is needed
- Guide users through the process
- Handle success and failure states appropriately