Commit 5052c91e authored by keita.onoguchi's avatar keita.onoguchi

ログイン機能実装途中

parent 9d431c28
...@@ -6,6 +6,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException; ...@@ -6,6 +6,7 @@ import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import com.example.domain.LoginUser;
import com.example.repository.UserRepository; import com.example.repository.UserRepository;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -23,6 +24,9 @@ public class LoginUserDetailsService implements UserDetailsService { ...@@ -23,6 +24,9 @@ public class LoginUserDetailsService implements UserDetailsService {
@Override @Override
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException{ public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException{
assert(email != null); assert(email != null);
log.debug(); log.debug("loadUserByUsername(email):[{}]", email);
return userRepository.findByEmail(email)
.map(LoginUser::new)
.orElseThrow(() -> new UsernameNotFoundException("User not found by email:[" + email + "]"));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment