Skip to content

Commit da210ca

Browse files
committed
instance onAuth(): fix forwarding auth.token to server.
1 parent fd3e7b8 commit da210ca

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "colyseus.js",
3-
"version": "0.16.15",
3+
"version": "0.16.16",
44
"description": "Colyseus Multiplayer SDK for JavaScript/TypeScript",
55
"author": "Endel Dreyer",
66
"license": "MIT",
@@ -58,7 +58,7 @@
5858
"node": ">= 12.x"
5959
},
6060
"dependencies": {
61-
"@colyseus/msgpackr": "^1.10.5",
61+
"@colyseus/msgpackr": "^1.11.2",
6262
"@colyseus/schema": "^3.0.0",
6363
"httpie": "^2.0.0-next.13",
6464
"tslib": "^2.1.0",

src/Client.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ export class Client {
229229
protected buildEndpoint(room: any, options: any = {}, protocol: string = "ws") {
230230
const params = [];
231231

232+
// forward authentication token
233+
if (this.http.authToken) {
234+
options['_authToken'] = this.http.authToken;
235+
}
236+
232237
// append provided options
233238
for (const name in options) {
234239
if (!options.hasOwnProperty(name)) {

0 commit comments

Comments
 (0)