|
@@ -3,7 +3,6 @@ package es.uv.garcosda.security;
|
|
|
import java.io.IOException;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.authentication.AuthenticationManager;
|
|
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
|
import org.springframework.security.core.Authentication;
|
|
@@ -20,15 +19,14 @@ import jakarta.servlet.http.HttpServletResponse;
|
|
|
|
|
|
public class CustomAuthenticationFilter extends UsernamePasswordAuthenticationFilter{
|
|
|
|
|
|
- @Autowired
|
|
|
private AuthenticationManager authenticationManager;
|
|
|
|
|
|
- @Autowired
|
|
|
private JwtService jwtService;
|
|
|
|
|
|
- public CustomAuthenticationFilter(AuthenticationManager authenticationManager) {
|
|
|
+ public CustomAuthenticationFilter(AuthenticationManager authenticationManager, JwtService jwtService) {
|
|
|
this.authenticationManager = authenticationManager;
|
|
|
- }
|
|
|
+ this.jwtService = jwtService;
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public Authentication attemptAuthentication(HttpServletRequest request, HttpServletResponse response) throws AuthenticationException {
|