feat(auth): implement custom user details and enhance JWT token payload
- Introduce CustomUserDetails to encapsulate user information and authorities - Remove redundant UserProfileResponse from AuthTokenResponse - Add userId, nickname, and avatar claims to JWT token generation - Update UserDetailsServiceImpl to use CustomUserDetails - Modify JwtTokenUtil to accept CustomUserDetails and include additional claims - Add avatar field to User entity - Update UserMapper to map avatar field in result mappings - Add logging for successful and failed login attempts
This commit is contained in:
@@ -40,6 +40,11 @@ public class User {
|
||||
*/
|
||||
private String nickname;
|
||||
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 状态 (1:启用, 0:禁用)
|
||||
*/
|
||||
|
||||
@@ -6,5 +6,4 @@ import lombok.Data;
|
||||
public class AuthTokenResponse {
|
||||
private String tokenHead;
|
||||
private String token;
|
||||
private UserProfileResponse userProfile;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user