Skip to content

Commit

Permalink
LoginController: Add @ConditionalOnBean(ClientRegistrationRepository)
Browse files Browse the repository at this point in the history
This ensures it's not loaded in the unit tests which don't have this
bean. Even though OIDC_URL might be defined in the environment.
  • Loading branch information
ato committed May 2, 2024
1 parent 88f523b commit 1e6bdd9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ui/src/pandas/core/LoginController.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pandas.core;

import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.client.authentication.OAuth2AuthenticationToken;
Expand All @@ -21,6 +22,7 @@

@Controller
@ConditionalOnProperty("OIDC_URL")
@ConditionalOnBean(ClientRegistrationRepository.class)
public class LoginController {
private final ClientRegistrationRepository clientRegistrationRepository;

Expand Down

0 comments on commit 1e6bdd9

Please sign in to comment.