mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
🐛 Fixing a bug. websocket 问题 修改,获取用户信息错误
This commit is contained in:
1 parent
dfa8737d80
commit
c11757d455
1 file changed
+1
-1
+1
-1
@@ -61,7 +61,7 @@ public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
OAuth2Authentication auth2Authentication = tokenService.loadAuthentication(tokens.split(" ")[1]);
|
||||
if (ObjectUtil.isNotNull(auth2Authentication)) {
|
||||
SecurityContextHolder.getContext().setAuthentication(auth2Authentication);
|
||||
accessor.setUser(() -> (String) auth2Authentication.getPrincipal());
|
||||
accessor.setUser(() -> auth2Authentication.getName());
|
||||
return message;
|
||||
} else {
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user