fix: callbacks cleanup and credential timestamp validation (#1669)
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
Release NapCat / validate-version (push) Canceled after 0s
Release NapCat / Build-Framework (push) Canceled after 0s
Release NapCat / Build-Shell (push) Canceled after 0s
Release NapCat / Download-QNX64 (push) Canceled after 0s
Release NapCat / release-napcat (push) Canceled after 0s
* fix(rpc): clean callbacks when sending failed * chore: format * fix(pty): handle ws message properly * fix(webui-backend): unify credential timestamp validation Store credential CreatedTime in seconds and validate expiry using the same unit. Keep backward compatibility for legacy millisecond timestamps. * chore: format * Revert "chore: format" This reverts commit 6f2e9f1b53b55e8f4bf4a747ed7b05a0d6e4dbb4. * fix: naming Rename ONE_HOUR_SECONDS to MAX_CREDENTIAL_VALID_SECONDS for clearer intent. Simplify CreatedTime parsing by using Math.floor(Number(...)) and remove the legacy millisecond-to-second conversion branch. Update the time-difference check to use the new constant name.
This commit is contained in:
4 files changed
+39
-10
No files matched your search
@@ -84,7 +84,13 @@ class TerminalManager {
|
||||
|
||||
ws.on('message', (data) => {
|
||||
if (instance) {
|
||||
const result = JSON.parse(data.toString());
|
||||
let text: string;
|
||||
if (Array.isArray(data)) {
|
||||
text = Buffer.concat(data).toString();
|
||||
} else {
|
||||
text = data.toString();
|
||||
}
|
||||
const result = JSON.parse(text);
|
||||
if (result.type === 'input') {
|
||||
instance.pty.write(result.data);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user