aboutsummaryrefslogtreecommitdiffstats
path: root/core/Controller/WebAuthnController.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/Controller/WebAuthnController.php')
-rw-r--r--core/Controller/WebAuthnController.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/core/Controller/WebAuthnController.php b/core/Controller/WebAuthnController.php
index 1eab5c79be6..81e6daf51c7 100644
--- a/core/Controller/WebAuthnController.php
+++ b/core/Controller/WebAuthnController.php
@@ -7,6 +7,7 @@ declare(strict_types=1);
*
* @author Christoph Wurst <christoph@winzerhof-wurst.at>
* @author Roeland Jago Douma <roeland@famdouma.nl>
+ * @author Richard Steinmetz <richard@steinmetz.cloud>
*
* @license GNU AGPL version 3 or any later version
*
@@ -29,6 +30,7 @@ namespace OC\Core\Controller;
use OC\Authentication\Login\LoginData;
use OC\Authentication\Login\WebAuthnChain;
use OC\Authentication\WebAuthn\Manager;
+use OC\URLGenerator;
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\JSONResponse;
@@ -46,14 +48,16 @@ class WebAuthnController extends Controller {
private ISession $session;
private LoggerInterface $logger;
private WebAuthnChain $webAuthnChain;
+ private UrlGenerator $urlGenerator;
- public function __construct($appName, IRequest $request, Manager $webAuthnManger, ISession $session, LoggerInterface $logger, WebAuthnChain $webAuthnChain) {
+ public function __construct($appName, IRequest $request, Manager $webAuthnManger, ISession $session, LoggerInterface $logger, WebAuthnChain $webAuthnChain, URLGenerator $urlGenerator) {
parent::__construct($appName, $request);
$this->webAuthnManger = $webAuthnManger;
$this->session = $session;
$this->logger = $logger;
$this->webAuthnChain = $webAuthnChain;
+ $this->urlGenerator = $urlGenerator;
}
/**
@@ -106,6 +110,8 @@ class WebAuthnController extends Controller {
);
$this->webAuthnChain->process($loginData);
- return new JSONResponse([]);
+ return new JSONResponse([
+ 'defaultRedirectUrl' => $this->urlGenerator->linkToDefaultPageUrl(),
+ ]);
}
}