Skip to content
This repository was archived by the owner on Apr 5, 2022. It is now read-only.

Make ConnectController and ProviderSignInController more extendable #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ public class ConnectController {

private final static Log logger = LogFactory.getLog(ConnectController.class);

private final ConnectionFactoryLocator connectionFactoryLocator;
protected final ConnectionFactoryLocator connectionFactoryLocator;

private final ConnectionRepository connectionRepository;

private final MultiValueMap<Class<?>, ConnectInterceptor<?>> interceptors = new LinkedMultiValueMap<Class<?>, ConnectInterceptor<?>>();

private final ConnectSupport webSupport = new ConnectSupport();
protected final ConnectSupport webSupport = new ConnectSupport();

private final UrlPathHelper urlPathHelper = new UrlPathHelper();

Expand Down Expand Up @@ -284,7 +284,7 @@ private String getViewPath() {
return "connect/";
}

private void addConnection(Connection<?> connection, ConnectionFactory<?> connectionFactory, WebRequest request) {
protected void addConnection(Connection<?> connection, ConnectionFactory<?> connectionFactory, WebRequest request) {
try {
connectionRepository.addConnection(connection);
postConnect(connectionFactory, connection, request);
Expand All @@ -294,7 +294,7 @@ private void addConnection(Connection<?> connection, ConnectionFactory<?> connec
}

@SuppressWarnings({ "rawtypes", "unchecked" })
private void preConnect(ConnectionFactory<?> connectionFactory, MultiValueMap<String, String> parameters, WebRequest request) {
protected void preConnect(ConnectionFactory<?> connectionFactory, MultiValueMap<String, String> parameters, WebRequest request) {
for (ConnectInterceptor interceptor : interceptingConnectionsTo(connectionFactory)) {
interceptor.preConnect(connectionFactory, parameters, request);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ProviderSignInController {

private final static Log logger = LogFactory.getLog(ProviderSignInController.class);

private final ConnectionFactoryLocator connectionFactoryLocator;
protected final ConnectionFactoryLocator connectionFactoryLocator;

private final UsersConnectionRepository usersConnectionRepository;

Expand All @@ -63,7 +63,7 @@ public class ProviderSignInController {

private String postSignInUrl = "/";

private final ConnectSupport webSupport = new ConnectSupport();
protected final ConnectSupport webSupport = new ConnectSupport();

/**
* Creates a new provider sign-in controller.
Expand Down Expand Up @@ -182,7 +182,7 @@ public RedirectView canceledAuthorizationCallback() {

// internal helpers

private RedirectView handleSignIn(Connection<?> connection, NativeWebRequest request) {
protected RedirectView handleSignIn(Connection<?> connection, NativeWebRequest request) {
List<String> userIds = usersConnectionRepository.findUserIdsWithConnection(connection);
if (userIds.size() == 0) {
ProviderSignInAttempt signInAttempt = new ProviderSignInAttempt(connection, connectionFactoryLocator, usersConnectionRepository);
Expand Down