Merge pull request #7971 from annando/issue-7685
Issue 7685: Just forward on remoteauth for non legacy-DFRN and other contacts
This commit is contained in:
commit
85ae12a873
1 changed files with 6 additions and 3 deletions
|
@ -5098,14 +5098,17 @@ function api_friendica_remoteauth()
|
||||||
// traditional DFRN
|
// traditional DFRN
|
||||||
|
|
||||||
$contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]);
|
$contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]);
|
||||||
|
if (!DBA::isResult($contact)) {
|
||||||
if (!DBA::isResult($contact) || ($contact['network'] !== Protocol::DFRN)) {
|
|
||||||
throw new BadRequestException("Unknown contact");
|
throw new BadRequestException("Unknown contact");
|
||||||
}
|
}
|
||||||
|
|
||||||
$cid = $contact['id'];
|
$cid = $contact['id'];
|
||||||
|
|
||||||
$dfrn_id = $contact['issued-id'] ?? $contact['dfrn-id'];
|
$dfrn_id = $contact['issued-id'] ?: $contact['dfrn-id'];
|
||||||
|
|
||||||
|
if (($contact['network'] !== Protocol::DFRN) || empty($dfrn_id)) {
|
||||||
|
System::externalRedirect($url ?: $c_url);
|
||||||
|
}
|
||||||
|
|
||||||
if ($contact['duplex'] && $contact['issued-id']) {
|
if ($contact['duplex'] && $contact['issued-id']) {
|
||||||
$orig_id = $contact['issued-id'];
|
$orig_id = $contact['issued-id'];
|
||||||
|
|
Loading…
Reference in a new issue