small cleanup

This commit is contained in:
zefie
2026-05-05 14:39:39 -04:00
parent fd67132da9
commit 750435fc83
5 changed files with 19 additions and 960 deletions

View File

@@ -644,6 +644,24 @@ class WTVShared {
return null;
}
/**
* Checks if a token is valid (exists and not expired)
* @param {string} token The token to check
* @returns {boolean} true if valid, false if not
*/
isTokenValid(token) {
const session = this.tokens[token];
if (session && session.expires > Date.now()) {
return true;
}
this.deleteToken(token);
return false;
}
/**
* Deletes a token from the token store.
* @param {string} token The token to delete
*/
deleteToken(token) {
delete this.tokens[token];
this.saveTokens();