code: private RedirectView handleSignIn(Connection<?> connection, ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
  		List<String> userIds = usersConnectionRepository.findUserIdsWithConnection(connection);
  		if (userIds.size() == 0) {
  			ProviderSignInAttempt signInAttempt = new ProviderSignInAttempt(connection);
  			sessionStrategy.setAttribute(request, ProviderSignInAttempt.SESSION_ATTRIBUTE, signInAttempt);
  			return redirect(signUpUrl);
  		} else if (userIds.size() == 1) {
  			usersConnectionRepository.createConnectionRepository(userIds.get(0)).updateConnection(connection);
  			String originalUrl = signInAdapter.signIn(userIds.get(0), connection, request);
  			postSignIn(connectionFactory, connection, (WebRequest) request);
  			return originalUrl != null ? redirect(originalUrl) : redirect(postSignInUrl);
  		} else {
  			return redirect(URIBuilder.fromUri(signInUrl).queryParam("error", "multiple_users").build().toString());
  		}
  	}
docs: internal helpers