We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7ca7c8 commit dd369adCopy full SHA for dd369ad
js-src/Websocket.ts
@@ -136,9 +136,15 @@ export class Websocket {
136
if (channel.name.startsWith('private-') || channel.name.startsWith('presence-')) {
137
console.log(`Sending auth request for channel ${channel.name}`)
138
139
+ if (this.options.bearerToken) {
140
+ this.options.auth.headers['Authorization'] = 'Bearer ' + this.options.bearerToken;
141
+ }
142
+
143
axios.post(this.options.authEndpoint, {
144
socket_id: this.getSocketId(),
145
channel_name: channel.name,
146
+ }, {
147
+ headers: this.options.auth.headers || {}
148
}).then((response: AxiosResponse) => {
149
console.log(`Subscribing to channels ${channel.name}`)
150
0 commit comments