Skip to content

Commit

Permalink
Move custom authorizer channel into separate type
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszGrajdek committed Sep 20, 2023
1 parent 429e119 commit 7ebcd09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libs/PusherConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Log from './Log';
import CONST from '../CONST';

type EventCallbackError = {type: ValueOf<typeof CONST.ERROR>; data: {code: number}};
type CustomAuthorizerChannel = {name: string};

function init() {
/**
Expand All @@ -13,7 +14,7 @@ function init() {
* current valid token to generate the signed auth response
* needed to subscribe to Pusher channels.
*/
Pusher.registerCustomAuthorizer((channel: {name: string}) => ({
Pusher.registerCustomAuthorizer((channel: CustomAuthorizerChannel) => ({
authorize: (socketID: string, callback: () => void) => {
Session.authenticatePusher(socketID, channel.name, callback);
},
Expand Down

0 comments on commit 7ebcd09

Please sign in to comment.