-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[types] Invalid type definition for channelAuthorization
with customHandler
#715
Comments
i thought this was strange too.. for reference, my client definition looks like this: export const pusherClient = new PusherClient(process.env.NEXT_PUBLIC_PUSHER_KEY, {
cluster: process.env.NEXT_PUBLIC_PUSHER_CLUSTER,
channelAuthorization: {
endpoint: '', // doesn't seem needed
transport: 'ajax', // doesn't seem needed
customHandler: async (channelInfo, callback) => {
trpcProxy.pusher.authorize.query(channelInfo)
.then(auth => callback(null, auth))
.catch(err => callback(err, null));
},
},
userAuthentication: {
endpoint: '', // doesn't seem needed
transport: 'ajax', // doesn't seem needed
customHandler: async ({ socketId }, callback) => {
trpcProxy.pusher.authenticate.query({ socketId })
.then(auth => callback(null, auth))
.catch(err => callback(err, null));
},
},
}); |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you'd like this issue to stay open please leave a comment indicating how this issue is affecting you. Thank you. |
Those fields are indeed not needed, I provided a fix in this PR. |
This is now fixed in >= v8.4.0-rc2 |
I noticed the issue when I tried to migrate the legacy
authorizer
to the newercustomHandler
.It looks like when I define a
customHandler
, the type definition still requires providingtransport
andendpoint
fields inchannelAuthorization
object. It doesn't look as if theses 2 have any purpose. Maybe they should be marked as optional if customeHandler is provided? 🤔The text was updated successfully, but these errors were encountered: