I ran into a couple of quirks with Custom API Auth and was wondering if there are solutions.
- During development or preview, if the custom API auth expires or isn't present, the login/auth prompt (modal) isn't shown. This causes the API calls to fail.
- In live mode, if the custom API auth expires, API calls fail silently until the user refreshes the page (to see the auth again).
Are there known quirks or am I missing something?
Do you have a time-based auth trigger configured on your resource? With it you should be able to automatically re-trigger your auth flow after a specified amount of time without the user having to refresh the page. This only works in preview mode though, in editor mode you'll still need to manually click the refresh button.
It might also be helpful to set up a refresh flow which will trigger whenever a
4xx error is returned before Retool re-attempts the request.
@Kabirdas Yes, I'm using time-based auth trigger. Is the expected behavior in live and preview mode that it would auto prompt the user for auth after expiry - w/o a page refresh? If it works like that out of the box then we don't need a refresh-flow since the experience is good enough for internal needs.
At the moment users should be able to auth by clicking an alert that shows in the pill in the lower left of the screen once the time has expired:
This may easily be overlooked by users though and the dev team is reconsidering the flow for apps where auth has expired. You might explore having your query trigger a modal containing an auth login component when it fails with a
Could that work for now?