Fix bugs caused by Expense/Income controllers

This commit is contained in:
DmitriiCravcenco
2023-10-04 08:57:52 +03:00
parent 5e0000d532
commit b396c1c137
14 changed files with 45 additions and 57 deletions

View File

@@ -9,6 +9,7 @@ import com.faf223.expensetrackerfaf.model.User;
import com.faf223.expensetrackerfaf.repository.CredentialRepository;
import com.faf223.expensetrackerfaf.repository.UserRepository;
import com.faf223.expensetrackerfaf.security.PersonDetails;
import lombok.RequiredArgsConstructor;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
@@ -16,6 +17,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service;
@Service
@RequiredArgsConstructor
public class AuthenticationService {
private final UserRepository userRepository;
@@ -24,14 +26,6 @@ public class AuthenticationService {
private final JwtService jwtService;
private final AuthenticationManager authenticationManager;
public AuthenticationService(UserRepository repository, CredentialRepository credentialRepository, PasswordEncoder passwordEncoder, JwtService jwtService, AuthenticationManager authenticationManager) {
this.userRepository = repository;
this.credentialRepository = credentialRepository;
this.passwordEncoder = passwordEncoder;
this.jwtService = jwtService;
this.authenticationManager = authenticationManager;
}
public AuthenticationResponse register(RegisterRequest request) {
User user = User.builder()