<?php
/**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2022, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\DI;
use Friendica\Model\Contact;
use Friendica\Model\Profile;
+use Friendica\Network\HTTPClient\Client\HttpClientAccept;
+use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Util\Strings;
function redir_init(App $a) {
// Local user is already authenticated.
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;
- Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);
+ Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url);
$a->redirect($target_url);
}
}
// Remote user is already authenticated.
redir_check_url($contact_url, $url);
$target_url = $url ?: $contact_url;
- Logger::log($contact['name'] . " is already authenticated. Redirecting to " . $target_url, Logger::DEBUG);
+ Logger::info($contact['name'] . " is already authenticated. Redirecting to " . $target_url);
$a->redirect($target_url);
}
}
$url .= $separator . 'zrl=' . urlencode($my_profile);
}
- Logger::log('redirecting to ' . $url, Logger::DEBUG);
+ Logger::info('redirecting to ' . $url);
$a->redirect($url);
}
}
// Test for magic auth on the target system
- $serverret = DI::httpRequest()->get($basepath . '/magic');
+ $serverret = DI::httpClient()->head($basepath . '/magic', [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::HTML]);
if ($serverret->isSuccess()) {
$separator = strpos($target_url, '?') ? '&' : '?';
$target_url .= $separator . 'zrl=' . urlencode($visitor) . '&addr=' . urlencode($contact_url);