I have a number of actions that interact with a REST API which were generated using the “import from OpenAPI” function. One of those actions is a ‘v1/token’ for oauth for the other actions. Whats the most elegant way to use this action before the other actions to ensure I have the correct ‘accessToken’ in the other actions?
I assume I will have to
- Modify each OpenAPI generated action to run another “auth” action
- The “auth” action would store tokens in Hasura Postgres db and a) check if a valid token exists and if not b) fetch a new token and store it and then c) pass it to the original OpenAPI generated action
- The OpenAPI action uses the token in its header
Not sure how to do this flow in Hasura if this is the correct way to do it.