Creative ideas to enhance performance? EG getting Access Token into React App
nicolasiscoding opened this issue · comments
Hello, I am writing an add-on for Google Docs and I noticed my getAccessToken() server-side function takes too long and could impact UX moving between states. Right now, my app is structured in the following flow:
-
Modal which redirects to our Login Page using Auth Code Flow with PKCE (using https://github.com/googleworkspace/apps-script-oauth2)
-
Storing the Access Token in PropertiesService.getUserProperties()
-
Closing the Modal and opening a Sidebar (main app)
-
Making another Google App Scripts Server Call to retrieve the Access Token from the Properties Service.
I'm trying to find a happy medium to minimize the amount of slow-running Google App Script calls to make sense like using fetch on the React App where needed.
Trying to understand the flow a bit more. Is the idea that if you log in in the modal you can also be logged in when opening the sidebar?