|
|
@@ -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(), |
|
|
|
]); |
|
|
|
} |
|
|
|
} |