mirror of
https://github.com/nextcloud/server.git
synced 2026-02-03 20:41:22 -05:00
Merge 1ba58415e6 into d09b8c99de
This commit is contained in:
commit
62f886259f
1 changed files with 20 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
|||
*/
|
||||
namespace OCA\Federation\Controller;
|
||||
|
||||
use OCA\Federation\BackgroundJob\RequestSharedSecret;
|
||||
use OCA\Federation\DbHandler;
|
||||
use OCA\Federation\TrustedServers;
|
||||
use OCP\AppFramework\Http;
|
||||
|
|
@ -109,6 +110,25 @@ class OCSAuthAPIController extends OCSController {
|
|||
$this->logger->info(
|
||||
'remote server (' . $url . ') presented lower token. We will initiate the exchange of the shared secret.'
|
||||
);
|
||||
|
||||
$hasJob = false;
|
||||
foreach ($this->jobList->getJobsIterator(RequestSharedSecret::class, null, 0) as $job) {
|
||||
$arg = $job->getArgument();
|
||||
if (is_array($arg) && isset($arg['url']) && $arg['url'] === $url) {
|
||||
$hasJob = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$hasJob) {
|
||||
$this->jobList->add(
|
||||
RequestSharedSecret::class,
|
||||
[
|
||||
'url' => $url,
|
||||
'token' => $this->dbHandler->getToken($url),
|
||||
'created' => $this->timeFactory->getTime()
|
||||
]
|
||||
);
|
||||
}
|
||||
throw new OCSForbiddenException();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue