Fixed JWT Role assignment and method access
This commit is contained in:
@@ -10,7 +10,7 @@ import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@@ -22,7 +22,7 @@ public class PersonDetails implements UserDetails {
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return List.of(new SimpleGrantedAuthority(credential.getRole().name()));
|
||||
return Collections.singletonList(new SimpleGrantedAuthority(credential.getRole().toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user