fix: 令牌驗證額外添加是否為有效令牌
* 如果解密無效, 直接返回一個無效的令牌, 並加以判斷
This commit is contained in:
@@ -25,7 +25,7 @@ export default abstract class BaseApi {
|
||||
}
|
||||
checkToken(token: Token, deviceId: string) {
|
||||
if (token.expired_time < Date.now()) return false
|
||||
if (!User.findById(token.author)) return false
|
||||
if (!token.author || !User.findById(token.author)) return false
|
||||
if (deviceId != null)
|
||||
if (token.device_id != deviceId)
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user