Resource query not working when inserted in a module to detect login

Hi everyone,

We have setup retool in a way where 2 of our panels are on it. Now the way we have setup authentication is that - 1 panel uses an admin resource which has the authentication check using the status code which works perfectly.

Panel 2 also uses a token from this admin resource (we store it as a variable and then use it) but has a different base URL, so the above check is not possible since we don't use the same resource for Panel 2's queries.

Now I need a way to get the authentication check on panel 2 without having to add a specific query in every single app which will ensure my endpoint authentication check runs.

We tried doing this by adding a query in a module which is used in all apps in Panel 2, the query is run and returns an error as expected, but it does not trigger the login flow.

Please help, sorry in advance if I wasn't able to explain the requirement properly!

Hi @Ritik_Garg,

Thanks for reaching out! I think I'm following, but we typically recommend trying to keep authentication on the resource set up page, rather than passing tokens within an app. Any chance you could add some custom authentication to the second resource to handle getting the token? If not, could you share some screenshots of the current set up?

Hi Tess,

Thanks for your reply.

After posting this I came across retool's multi-page apps feature through which using global queries we have managed to come to a reasonable solution which solves my concern to a great degree, so we are marking this as solved internally!

1 Like

Nice - glad to hear you have a solution! :+1: