Append Authorization access token to RPC client in asynchronous way (amplify auth/cognito)
Im trying to use RPC but I use AMPLIFY AUTH and i want to append the access token in each rpc clients.
the problem is the way i retrieve my access token is async as cognito will refresh the token if needed. Is it bad to make the RCP client async?
... would be used lke this but i dont like it :
i dont like having to use it that way across my app but i guess I dont have a choice as long as my token retrieval is async?
1 Reply
Is this terrible?
having to create the client in a async way everytime i want to perform a http call.. :
fixed ✅: Hono client allows us to pass a function for headers that can be async :