mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
allow to revoke host tokens from web ui (#511)
* allow to revoke / restore host access from web ui * refector to what is expected * remove core.admin check on HostViewPage.tsx * update core.host.revoke_token description
This commit is contained in:
1 parent
838170a9ff
commit
e2dea35e02
11 files changed
+120
-10
No files matched your search
@@ -240,6 +240,11 @@ ${err.stack}`
|
||||
if ((tokenPayload.host !== undefined ? tokenPayload.host : tokenPayload.slave) !== data.id) {
|
||||
throw new Error("missmatched host id");
|
||||
}
|
||||
|
||||
let host = this.controller.hosts!.get(data.id);
|
||||
if (!tokenPayload.iat || tokenPayload.iat < (host?.token_valid_after??0)) {
|
||||
throw new Error("invalid token");
|
||||
}
|
||||
} catch (err: any) {
|
||||
logger.verbose(`WsServer | authentication failed for ${req.socket.remoteAddress}`);
|
||||
wsRejectedConnectionsCounter.inc();
|
||||
|
||||
Reference in new issue
Block a user