From 000749f7d91ecef3585633bcfd38c00692ce44f5 Mon Sep 17 00:00:00 2001 From: Levi Yan Date: Sun, 23 Mar 2025 22:16:49 +0800 Subject: [PATCH] revert islogged function check token validation and clean expired tokens --- src/user.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/user.ts b/src/user.ts index 64d59a0..d9d3a60 100644 --- a/src/user.ts +++ b/src/user.ts @@ -32,12 +32,12 @@ export default class User { this.devstarHostname = parsedUrl.hostname.replace(/\./g, '_'); //提取hostname,并用下划线替换. } - public async login(token: string, username: string): Promise { + public async login(token: string, username: string) { const devstarAPIHandler = new DevstarAPIHandler() try { const res = await devstarAPIHandler.verifyToken(token, username) - if (res !== 'ok') { + if (!res) { throw new Error('Token verification failed') }