diff --git a/apps/federation/lib/Controller/OCSAuthAPIController.php b/apps/federation/lib/Controller/OCSAuthAPIController.php index ff99687d9926a..7428a49e01a7f 100644 --- a/apps/federation/lib/Controller/OCSAuthAPIController.php +++ b/apps/federation/lib/Controller/OCSAuthAPIController.php @@ -110,7 +110,7 @@ public function requestSharedSecret(string $url, string $token): DataResponse { 'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.', ['app' => 'federation'] ); - throw new OCSForbiddenException(); + return new DataResponse(); } $this->jobList->add( diff --git a/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php b/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php index 9214775c2cc3e..d8a69338889b8 100644 --- a/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php +++ b/apps/federation/tests/Controller/OCSAuthAPIControllerTest.php @@ -105,9 +105,9 @@ public function testRequestSharedSecret(string $token, string $localToken, bool try { $this->ocsAuthApi->requestSharedSecret($url, $token); - $this->assertTrue($ok); + $this->assertTrue($isTrustedServer); } catch (OCSForbiddenException $e) { - $this->assertFalse($ok); + $this->assertFalse($isTrustedServer); } } @@ -160,7 +160,6 @@ public function testGetSharedSecret(bool $isTrustedServer, bool $isValidToken, b try { $result = $ocsAuthApi->getSharedSecret($url, $token); - $this->assertTrue($ok); $data = $result->getData(); $this->assertSame('secret', $data['sharedSecret']); } catch (OCSForbiddenException $e) {