From c58d8159d7bdee93a67a917e16b750fe99df9f99 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Tue, 31 May 2016 10:48:14 +0200 Subject: Create session tokens for apache auth users --- settings/Controller/AuthSettingsController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'settings/Controller') diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php index 2417f5f8218..fba663b034d 100644 --- a/settings/Controller/AuthSettingsController.php +++ b/settings/Controller/AuthSettingsController.php @@ -23,6 +23,7 @@ namespace OC\Settings\Controller; use OC\AppFramework\Http; use OC\Authentication\Exceptions\InvalidTokenException; +use OC\Authentication\Exceptions\PasswordlessTokenException; use OC\Authentication\Token\IProvider; use OC\Authentication\Token\IToken; use OCP\AppFramework\Controller; @@ -101,7 +102,11 @@ class AuthSettingsController extends Controller { try { $sessionToken = $this->tokenProvider->getToken($sessionId); $loginName = $sessionToken->getLoginName(); - $password = $this->tokenProvider->getPassword($sessionToken, $sessionId); + try { + $password = $this->tokenProvider->getPassword($sessionToken, $sessionId); + } catch (PasswordlessTokenException $ex) { + $password = null; + } } catch (InvalidTokenException $ex) { $resp = new JSONResponse(); $resp->setStatus(Http::STATUS_SERVICE_UNAVAILABLE); -- cgit v1.2.3