package com.weiwojc.security; import lombok.Getter; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import java.util.Collection; import java.util.Collections; @Getter public class JwtUserDetails implements UserDetails { private final Long userId; private final String username; public JwtUserDetails(Long userId, String username) { this.userId = userId; this.username = username; } @Override public Collection getAuthorities() { return Collections.emptyList(); } @Override public String getPassword() { return null; } @Override public String getUsername() { return username; } @Override public boolean isAccountNonExpired() { return true; } @Override public boolean isAccountNonLocked() { return true; } @Override public boolean isCredentialsNonExpired() { return true; } @Override public boolean isEnabled() { return true; } }