Fixed issue with circular dependencies

This commit is contained in:
Nickolus Snyder 2016-12-23 07:51:24 -08:00
parent 7091258de4
commit d94f7e3aa1

View File

@ -29,15 +29,19 @@ import com.svlada.user.service.DatabaseUserService;
*/ */
@Component @Component
public class AjaxAuthenticationProvider implements AuthenticationProvider { public class AjaxAuthenticationProvider implements AuthenticationProvider {
private final BCryptPasswordEncoder encoder; private BCryptPasswordEncoder encoder;
private final DatabaseUserService userService; private final DatabaseUserService userService;
@Autowired @Autowired
public AjaxAuthenticationProvider(final DatabaseUserService userService, final BCryptPasswordEncoder encoder) { public void setProjectRepository(final BCryptPasswordEncoder encoder) {
this.userService = userService;
this.encoder = encoder; this.encoder = encoder;
} }
@Autowired
public AjaxAuthenticationProvider(final DatabaseUserService userService) {
this.userService = userService;
}
@Override @Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException { public Authentication authenticate(Authentication authentication) throws AuthenticationException {
Assert.notNull(authentication, "No authentication data provided"); Assert.notNull(authentication, "No authentication data provided");