diff options
author | Richard Steinmetz <richard@steinmetz.cloud> | 2022-12-05 12:51:53 +0100 |
---|---|---|
committer | Richard Steinmetz <richard@steinmetz.cloud> | 2022-12-05 12:51:53 +0100 |
commit | fc4dd3041cd5e52f35db2c89d011ab85afb49a0c (patch) | |
tree | 4897e8beb3edc1b62c285c1c9d8d5af6640245e3 /core/Controller | |
parent | e36e92bacefeac0cf28888b3e528ab97cbc2ed9f (diff) | |
download | nextcloud-server-fc4dd3041cd5e52f35db2c89d011ab85afb49a0c.tar.gz nextcloud-server-fc4dd3041cd5e52f35db2c89d011ab85afb49a0c.zip |
Fix default redirect on successful WebAuthn login
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/WebAuthnController.php | 10 |
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(), + ]); } } |