Skip to content

Commit fad5599

Browse files
[1.x] Replaces deprecated auth options for default Pusher (#407)
* swap out deprecated channel auth options * add missed header assignment
1 parent 8234ce0 commit fad5599

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/connector/connector.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ export abstract class Connector<TPublic extends Channel, TPrivate extends Channe
55
* Default connector options.
66
*/
77
private _defaultOptions: any = {
8-
auth: {
8+
channelAuthorization: {
9+
endpoint: '/broadcasting/auth',
910
headers: {},
1011
},
11-
authEndpoint: '/broadcasting/auth',
1212
userAuthentication: {
1313
endpoint: '/broadcasting/user-auth',
1414
headers: {},
@@ -43,14 +43,14 @@ export abstract class Connector<TPublic extends Channel, TPrivate extends Channe
4343
let token = this.csrfToken();
4444

4545
if (token) {
46-
this.options.auth.headers['X-CSRF-TOKEN'] = token;
46+
this.options.channelAuthorization.headers['X-CSRF-TOKEN'] = token;
4747
this.options.userAuthentication.headers['X-CSRF-TOKEN'] = token;
4848
}
4949

5050
token = this.options.bearerToken;
5151

5252
if (token) {
53-
this.options.auth.headers['Authorization'] = 'Bearer ' + token;
53+
this.options.channelAuthorization.headers['Authorization'] = 'Bearer ' + token;
5454
this.options.userAuthentication.headers['Authorization'] = 'Bearer ' + token;
5555
}
5656

0 commit comments

Comments
 (0)