]> git.mxchange.org Git - friendica.git/commitdiff
Issue 7685: Just forward on remoteauth for non legacy-DFRN and other contacts
authorMichael <heluecht@pirati.ca>
Thu, 19 Dec 2019 11:02:50 +0000 (11:02 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 19 Dec 2019 11:02:50 +0000 (11:02 +0000)
include/api.php

index 8b5f3315bd4a197e0990fcee9e952347e6708871..55a5d6f6d677ec5c8f4b8bb9b6e4a68e231bddd7 100644 (file)
@@ -5098,8 +5098,7 @@ 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");
        }
 
@@ -5107,6 +5106,10 @@ function api_friendica_remoteauth()
 
        $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'];
                $dfrn_id = '1:' . $orig_id;