hello, I would love an option to pass in a new onAuthRequest prop or change the authCallback to accept async functions
new Ably.Realtime({
onAuthRequest: async () => {
await ensureAuthRefreshed();
const res = await myApiClient.getAblyToken();
return res.result.data;
}
})
I think the current authCallback is super limited/clunky since its only synchronous.
This would also allow for ease of use for people who use trpc since it by default returns a nested data shape (res.result.data.json would be where the result is stored).
Issue is synchronized with this Jira Task by Unito