mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-20 06:07:53 +00:00
update
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: jackning 270580156@qq.com
|
||||
* @Date: 2024-01-29 16:21:46
|
||||
* @LastEditors: jackning 270580156@qq.com
|
||||
* @LastEditTime: 2024-11-20 12:45:50
|
||||
* @LastEditTime: 2025-08-08 17:47:25
|
||||
* @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
|
||||
* Please be aware of the BSL license restrictions before installing Bytedesk IM –
|
||||
* selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license.
|
||||
@@ -25,17 +25,25 @@ import com.bytedesk.core.socket.mqtt.MqttAuthService;
|
||||
@AllArgsConstructor
|
||||
public class MqttAuthService {
|
||||
|
||||
// private final UserService userService;
|
||||
// private final TokenRestService tokenRestService;
|
||||
|
||||
public Boolean checkValid(String username, String password) {
|
||||
// 客户端使用accessToken作为password传递,避免客户端存储密码
|
||||
String accessToken = password;
|
||||
log.debug("auth username {}, accessToken {}", username, accessToken);
|
||||
// if (!userService.checkToken(username, accessToken)) {
|
||||
// return false;
|
||||
// }
|
||||
|
||||
log.debug("mqtt auth username {}, accessToken {}", username, accessToken);
|
||||
return true;
|
||||
// if (accessToken != null && JwtUtils.validateJwtToken(accessToken)) {
|
||||
// // 从数据库验证token是否有效(未被撤销且未过期)
|
||||
// Optional<TokenEntity> tokenOpt = tokenRestService.findByAccessToken(accessToken);
|
||||
// if (tokenOpt.isPresent() && tokenOpt.get().isValid()) {
|
||||
// return true;
|
||||
// } else {
|
||||
// log.debug("mqtt auth Token is invalid or revoked");
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// log.debug("mqtt auth Token is invalid or expired");
|
||||
// return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user