]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7971 from annando/issue-7685
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 19 Dec 2019 12:51:49 +0000 (07:51 -0500)
committerGitHub <noreply@github.com>
Thu, 19 Dec 2019 12:51:49 +0000 (07:51 -0500)
Issue 7685: Just forward on remoteauth for non legacy-DFRN and other contacts

include/api.php

index 8b5f3315bd4a197e0990fcee9e952347e6708871..5c708c0b70a079cdc6f65fb9bbd6735a4bf960aa 100644 (file)
@@ -5098,14 +5098,17 @@ function api_friendica_remoteauth()
        // traditional DFRN
 
        $contact = DBA::selectFirst('contact', [], ['uid' => api_user(), 'nurl' => $c_url]);
-
-       if (!DBA::isResult($contact) || ($contact['network'] !== Protocol::DFRN)) {
+       if (!DBA::isResult($contact)) {
                throw new BadRequestException("Unknown contact");
        }
 
        $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']) {
                $orig_id = $contact['issued-id'];