Compare commits
4 Commits
2617b4a5ae
...
264b9a528a
Author | SHA1 | Date | |
---|---|---|---|
264b9a528a | |||
06cba204b5 | |||
277fbd22cd | |||
6d3f837d7c |
@ -3,9 +3,6 @@ package co.jp.app.service;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import co.jp.app.dto.RegistrationDto;
|
||||
import co.jp.app.entity.UserEntity;
|
||||
import co.jp.app.repository.UserRepository;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
@ -15,9 +12,12 @@ import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import co.jp.app.dto.RegistrationDto;
|
||||
import co.jp.app.entity.UserEntity;
|
||||
import co.jp.app.repository.UserRepository;
|
||||
|
||||
@Service
|
||||
public class UserService implements UserDetailsService {
|
||||
|
||||
@ -50,16 +50,17 @@ public class UserService implements UserDetailsService {
|
||||
UserEntity userEntity = userRepository.findByEmail(email)
|
||||
.orElseThrow(() -> new UsernameNotFoundException(email + " not found"));
|
||||
|
||||
Collection<? extends GrantedAuthority> authorities = Collections.singletonList(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
Collection<? extends GrantedAuthority> authorities = Collections
|
||||
.singletonList(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
|
||||
return new User(
|
||||
userEntity.getEmail(),
|
||||
userEntity.getPassword(),
|
||||
true, // enabled
|
||||
true, // accountNonExpired
|
||||
true, // credentialsNonExpired
|
||||
true, // accountNonLocked
|
||||
authorities // role
|
||||
true, // enabled
|
||||
true, // accountNonExpired
|
||||
true, // credentialsNonExpired
|
||||
true, // accountNonLocked
|
||||
authorities // role
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
2
target/classes/.gitignore
vendored
Normal file
2
target/classes/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/META-INF/
|
||||
/co/
|
@ -1,6 +1,6 @@
|
||||
#Generated by Maven Integration for Eclipse
|
||||
#Mon May 12 14:19:16 JST 2025
|
||||
m2e.projectLocation=C\:\\Users\\ichbi\\OneDrive\\\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\\dog-1
|
||||
#Mon May 12 15:57:02 JST 2025
|
||||
m2e.projectLocation=C\:\\Users\\Administrator\\git\\Dog-1
|
||||
m2e.projectName=dog-1
|
||||
groupId=co.jp.app
|
||||
artifactId=dog-2
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user