use of org.rstudio.studio.client.rsconnect.model.RSConnectServerInfo in project rstudio by rstudio.
the class RSAccountConnector method connectLocalAccount.
private void connectLocalAccount(final NewRSConnectAccountResult result, final ProgressIndicator indicator, final OperationWithInput<AccountConnectResult> onConnected) {
indicator.onProgress("Adding account...");
final RSConnectAuthUser user = result.getAuthUser();
final RSConnectServerInfo serverInfo = result.getServerInfo();
final RSConnectPreAuthToken token = result.getPreAuthToken();
server_.registerUserToken(serverInfo.getName(), result.getAccountNickname(), user.getId(), token, new ServerRequestCallback<Void>() {
@Override
public void onResponseReceived(Void result) {
onConnected.execute(AccountConnectResult.Successful);
}
@Override
public void onError(ServerError error) {
display_.showErrorMessage("Account Connect Failed", "Your account was authenticated successfully, but could " + "not be connected to RStudio. Make sure your installation " + "of the 'rsconnect' package is correct for the server " + "you're connecting to.\n\n" + serverInfo.getInfoString() + "\n" + error.getMessage());
onConnected.execute(AccountConnectResult.Failed);
}
});
}
Aggregations