I've been upgrading a few Drupal7 modules to Drupal8 but was wondering what the recommended transition from drupal_goto is?
Specifically (the last issue I have on this porting task) is converting:

D7:

drupal_goto(variable_get('discourse_server') . '/session/sso_login', array('query' => array("sso" => $return_payload, "sig" => $return_sig)));

Setting aside the Drupal_goto change, I believe the rest of it would look like:

drupal_goto(\Drupal::config('discourse.settings')->get('discourse_server') . '/session/sso_login', array('query' => array("sso" => $return_payload, "sig" => $return_sig)));

Assuming this is correct, what is the recommended way of addressing the depreciated drupal_goto in the above example?

Thanks.

Comments

ColdSun’s picture

As a potential solution for those wondering:

$link = new RedirectResponse(\Drupal::config('discourse.settings')->get('discourse_server') . '/session/sso_login?sso=' . $return_payload . '&sig=' . $return_sig);
$link->send();

seems to work fine.