Compare commits

...

4 Commits

Author SHA1 Message Date
z
264b9a528a 更新了 2025-05-12 17:21:40 +09:00
z
06cba204b5 ok 2025-05-12 17:07:08 +09:00
z
277fbd22cd sss 2025-05-12 16:49:04 +09:00
z
6d3f837d7c saved 2025-05-12 16:31:18 +09:00
9 changed files with 16 additions and 13 deletions

View File

@ -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
View File

@ -0,0 +1,2 @@
/META-INF/
/co/

View File

@ -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