mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-28 05:49:47 +00:00
bugfix: user receives unauthorized on reconnection (#2601)
## Description: When rejoining, the client did not refresh the play token, so the jwt could be expired, causing the server to reject it. Also improved the error log when token fails ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -337,8 +337,10 @@ export async function startWorker() {
|
||||
|
||||
// Verify token signature
|
||||
const result = await verifyClientToken(clientMsg.token, config);
|
||||
if (result === false) {
|
||||
log.warn("Unauthorized: Invalid token");
|
||||
if (result.type === "error") {
|
||||
log.warn(`Invalid token: ${result.message}`, {
|
||||
clientID: clientMsg.clientID,
|
||||
});
|
||||
ws.close(1002, "Unauthorized");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user