Skip to content

Commit

Permalink
[SHIBUI-1058]
Browse files Browse the repository at this point in the history
use authentication name instead of principal
  • Loading branch information
jj committed Jan 29, 2019
1 parent fda8924 commit c0073b3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public User getCurrentUser() {
//TODO: Consider returning an Optional here
User user = null;
if (SecurityContextHolder.getContext() != null && SecurityContextHolder.getContext().getAuthentication() != null) {
String principal = (String) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
String principal = SecurityContextHolder.getContext().getAuthentication().getName();
if (StringUtils.isNotBlank(principal)) {
Optional<User> persistedUser = userRepository.findByUsername(principal);
if (persistedUser.isPresent()) {
Expand Down

0 comments on commit c0073b3

Please sign in to comment.