@colyseus/core 0.18.11 → 0.18.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Room.cjs +6 -3
- package/build/Room.cjs.map +2 -2
- package/build/Room.mjs +6 -3
- package/build/Room.mjs.map +2 -2
- package/build/Server.cjs +3 -2
- package/build/Server.cjs.map +2 -2
- package/build/Server.mjs +3 -2
- package/build/Server.mjs.map +2 -2
- package/package.json +8 -8
- package/src/Room.ts +10 -3
- package/src/Server.ts +7 -4
package/build/Room.cjs
CHANGED
|
@@ -1126,12 +1126,15 @@ var Room = class _Room {
|
|
|
1126
1126
|
try {
|
|
1127
1127
|
if (authData) {
|
|
1128
1128
|
client.auth = authData;
|
|
1129
|
-
}
|
|
1129
|
+
}
|
|
1130
|
+
const authedStatically = authData && this.constructor.onAuth !== _Room.onAuth;
|
|
1131
|
+
if (!authedStatically && this.onAuth !== _Room.prototype.onAuth) {
|
|
1130
1132
|
try {
|
|
1131
|
-
|
|
1132
|
-
if (!
|
|
1133
|
+
const result = await this.onAuth(client, joinOptions, authContext);
|
|
1134
|
+
if (!result) {
|
|
1133
1135
|
throw new import_ServerError.ServerError(import_shared_types.ErrorCode.AUTH_FAILED, "onAuth failed");
|
|
1134
1136
|
}
|
|
1137
|
+
client.auth = result === true && authData || result;
|
|
1135
1138
|
} catch (e) {
|
|
1136
1139
|
delete this._reservedSeats[sessionId];
|
|
1137
1140
|
await this.#_decrementClientCount();
|