Retool Custom Auth throws error even when I have a refresh auth in the workflow

Hi Retool team,

I have Custom Auth setup with Firebase but I am getting an error after I stay on the Retool dashboard for too long. Up until about 2 months ago, this was working fine, but it started breaking afterwards so not sure if it's something changed with Retool, Firebase, or I am just doing something wrong.

"error": {
"code": 401,
"message": "Custom Auth tokens expired. Last authenticated 2136.348 seconds ago with expiry of 1800 seconds.",

This error shouldn't show up because I have a custom reauth workflow that used to work. Did something change with Retool or is my firebase refresh messed up?

Hey @kungfoo!

Are you seeing this behavior in preview mode or is it only in the editor?

For some context - the auth trigger actually triggers the original auth flow that you have and only works in preview mode.

The refresh flow is specifically for when Retool tries to query the resource and gets a 4xx response. In that case, it will run automatically run the refresh flow and then try the request one more time before giving up and saying the request has failed.

Hey @Kabirdas - I am seeing this in editor mode. Not sure about preview or when it's published, but the reason this is an issue is that I am spending lots of time creating new dashboards and it takes a few hours. Basically, I keep getting logged out when I am making edits and it's really frustrating to not know if it's because of a wrong query or something happened with the auth.

That totally makes sense, we have an internal ticket for tracking this since it can be confusing/frustrating. I can let you know if there's an update here.

In the meantime, you might try adding an auth login button that only displays in editor mode. It might mitigate some of the steps to re-auth your resources making it easier to check that possibility off as you debug.

Could that help?

Hi! Any news on this topic? I am also having these Situtations, where i keep on searching for errors, while the reauth sometimes doesn't work in edit mode.

Hi @Marcel_Nehrig! No news yet. Just to double-check, when you say reauth doesn't work sometimes, are you saying your refresh flow isn't running in editor mode, or manually reauthenticating doesn't work?