aboutsummaryrefslogtreecommitdiff
path: root/juick-common/src/main/java/com/juick/service
diff options
context:
space:
mode:
Diffstat (limited to 'juick-common/src/main/java/com/juick/service')
-rw-r--r--juick-common/src/main/java/com/juick/service/UserService.java2
-rw-r--r--juick-common/src/main/java/com/juick/service/security/JuickUserDetailsService.java2
2 files changed, 2 insertions, 2 deletions
diff --git a/juick-common/src/main/java/com/juick/service/UserService.java b/juick-common/src/main/java/com/juick/service/UserService.java
index ef49a8ab..cfeaaa51 100644
--- a/juick-common/src/main/java/com/juick/service/UserService.java
+++ b/juick-common/src/main/java/com/juick/service/UserService.java
@@ -44,7 +44,7 @@ public interface UserService {
Optional<User> getUserByUID(int uid);
- User getUserByName(String username);
+ @Nonnull User getUserByName(String username);
User getUserByEmail(String email);
diff --git a/juick-common/src/main/java/com/juick/service/security/JuickUserDetailsService.java b/juick-common/src/main/java/com/juick/service/security/JuickUserDetailsService.java
index adb0ab44..59425fab 100644
--- a/juick-common/src/main/java/com/juick/service/security/JuickUserDetailsService.java
+++ b/juick-common/src/main/java/com/juick/service/security/JuickUserDetailsService.java
@@ -43,7 +43,7 @@ public class JuickUserDetailsService implements UserDetailsService {
com.juick.User user = userService.getUserByName(username);
- if (user != null) {
+ if (!user.isAnonymous()) {
user.setAuthHash(userService.getHashByUID(user.getUid()));
return new JuickUser(user);
}