OAuth2.0 does not work

Hmm my general recommendation when authentication requires some sort of user interaction - whether OAuth2 or a custom flow - is to define a verification endpoint, like Linda mentioned. This executes a test query to the provided endpoint when your app initially loads and, depending on the response, prompts the user to complete the authentication flow. After doing so, all page queries should then execute with the newly acquired credentials. This is actually fairly similar to the workaround that you've described here, but should be the more reliable option.

If you haven't already tried this, I would give it a shot before we dig too much deeper. You are always welcome to join our Office Hours, as well! It's generally easier to debug stuff like this live. :slightly_smiling_face: