We’re trying to integrate our backend’s 2FA system into Retool’s Custom Authentication workflow but have encountered a few blockers:
- No Conditional Modal Logic – We need to show a 2FA prompt based on a boolean response from our backend, but there’s no built-in way to conditionally trigger a modal within the Custom Auth workflow.
- Workaround Approach – To bypass this, we are using a REST API component to call our login endpoint, retrieve authentication tokens, and then manually paste the response JSON into a text field within the Custom Auth workflow. The expected JSON structure looks like this:
{
"response": {
"token": "",
"refreshToken": "",
"deviceToken": ""
}
}
- Issue with Parsing – However, when trying to reference or parse the pasted JSON within a JS component inside the Custom Auth workflow, we consistently get an internal server error.
We’d appreciate any guidance on resolving this issue, whether it involves troubleshooting the current approach or exploring a better way to integrate 2FA with our backend.
Thanks in advance for your help!