Support async authDataGenerator in generated typescript client
anish749 opened this issue · 1 comments
anish749 commented
Currently the typescript client generated using the client gen has the type auth?: string | AuthDataGenerator
where AuthDataGenerator
is of type () => (string | undefined)
This is great when the auth token is known / a function that return a known auth token. However in situations where auth token itself is returned via an API call / as a promise, the auth data generator doesn't work.
This happens with firebase auth, the auth token of the user is accessed using this and Promise
is returned because of an underlying API call.
The client side api call is already async.
Suggested change in generated code for the AuthDataGenerator
type:
export type AuthDataGenerator = () => Promise<string | undefined> | string | undefined
Happy to update the typescript client generator if this is a good idea.