1.6K Star 8.5K Fork 4K

GVPdromara / open-capacity-platform

 / 详情

isSingleLogin

待處理
創建於  
2023-08-12 21:20

base-spring-boot-starter#com.open.capacity.common.properties.AuthProperties#isSingleLogin

評論 (1)

nickling 創建了任务

输入图片说明
通过此处websocket处理同一账号同一时间在不同地点登陆实现登陆剔出功能
/**
* 踢出用户
*
* @chancelai authentication
* @chancelai existingAccessToken
*/
private void kickOutUser(OAuth2Authentication authentication, OAuth2AccessToken existingAccessToken) {
// 发送websocket通知
SimpMessagingTemplate simpMessagingTemplate = SpringUtil.getBean(SimpMessagingTemplate.class);
simpMessagingTemplate.convertAndSendToUser(existingAccessToken.getValue(), "/remind", "当前用户在别处登录");
if (existingAccessToken.getRefreshToken() != null) {
tokenStore.removeRefreshToken(existingAccessToken.getRefreshToken());
}
tokenStore.removeAccessToken(existingAccessToken);
}

登錄 後才可以發表評論

狀態
負責人
里程碑
Pull Requests
關聯的 Pull Requests 被合併後可能會關閉此 issue
分支
開始時間   -   結束時間
-
置頂選項
優先級
参与者(2)
1441068 somedaymail 1578951542 5437478 nickling 1578986705
Java
1
https://gitee.com/dromara/open-capacity-platform.git
git@gitee.com:dromara/open-capacity-platform.git
dromara
open-capacity-platform
open-capacity-platform

搜索幫助