aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_external/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2024-09-13 13:57:30 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2024-09-13 15:21:45 +0000
commit89bf1287086f79b252cf64d787034b9c8c72f130 (patch)
tree41a9e7165fd483bfbbe3c3145b934deb7659667e /apps/files_external/lib
parent91533fb6f7ac0d61f8016aafe5e06bed75fb7498 (diff)
downloadnextcloud-server-89bf1287086f79b252cf64d787034b9c8c72f130.tar.gz
nextcloud-server-89bf1287086f79b252cf64d787034b9c8c72f130.zip
fix(files_external): broken credentials dialog
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files_external/lib')
-rw-r--r--apps/files_external/lib/Controller/ApiController.php28
1 files changed, 0 insertions, 28 deletions
diff --git a/apps/files_external/lib/Controller/ApiController.php b/apps/files_external/lib/Controller/ApiController.php
index 56242938593..10fd120c3d9 100644
--- a/apps/files_external/lib/Controller/ApiController.php
+++ b/apps/files_external/lib/Controller/ApiController.php
@@ -15,7 +15,6 @@ use OCA\Files_External\Service\UserGlobalStoragesService;
use OCA\Files_External\Service\UserStoragesService;
use OCP\AppFramework\Http;
use OCP\AppFramework\Http\Attribute\NoAdminRequired;
-use OCP\AppFramework\Http\Attribute\OpenAPI;
use OCP\AppFramework\Http\DataResponse;
use OCP\AppFramework\OCSController;
use OCP\IRequest;
@@ -103,31 +102,4 @@ class ApiController extends OCSController {
return new DataResponse($entries);
}
-
- /**
- * Ask for credentials using a browser's native basic auth prompt
- * Then returns it if provided
- */
- #[NoAdminRequired]
- #[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)]
- public function askNativeAuth(): DataResponse {
- if (!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW'])) {
- $response = new DataResponse([], Http::STATUS_UNAUTHORIZED);
- $response->addHeader('WWW-Authenticate', 'Basic realm="Storage authentification needed"');
- return $response;
- }
-
- $user = $_SERVER['PHP_AUTH_USER'];
- $password = $_SERVER['PHP_AUTH_PW'];
-
- // Reset auth
- unset($_SERVER['PHP_AUTH_USER']);
- unset($_SERVER['PHP_AUTH_PW']);
-
- // Using 401 again to ensure we clear any cached Authorization
- return new DataResponse([
- 'user' => $user,
- 'password' => $password,
- ], Http::STATUS_UNAUTHORIZED);
- }
}