Convert login by id into login by email.
This commit is contained in:
1 parent
8d778e3571
commit
30e5ffa2eb
13 files changed
+144
-39
No files matched your search
+6
@@ -32,6 +32,12 @@ public class UserJpaAdapter implements UserPort {
|
||||
.map(UserEntity::toUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<User> findByEmail(String userEmail) {
|
||||
return userJpaRepository.findByEmail(userEmail)
|
||||
.map(UserEntity::toUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<User> findAll() {
|
||||
return userJpaRepository.findAll()
|
||||
|
||||
+3
@@ -15,6 +15,9 @@ public interface UserJpaRepository extends JpaRepository<UserEntity, UUID> {
|
||||
@Query("SELECT u FROM UserEntity u JOIN FETCH u.roles WHERE u.id = :userId")
|
||||
Optional<UserEntity> findById(@Param("userId") UUID userId);
|
||||
|
||||
@Query("SELECT u FROM UserEntity u JOIN FETCH u.roles WHERE u.email = :email")
|
||||
Optional<UserEntity> findByEmail(@Param("email") String userEmail);
|
||||
|
||||
@Query("SELECT u FROM UserEntity u JOIN FETCH u.roles")
|
||||
List<UserEntity> findAll();
|
||||
|
||||
|
||||
Reference in new issue
Block a user