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
committernextcloud-command <nextcloud-command@users.noreply.github.com>2024-09-13 14:32:07 +0000
commit0f519f4856fce91ec77b65b913a9b305271fb883 (patch)
tree2417dcf213c60cbfdcae88394d8da6275b832ff6 /apps/files_external/lib
parentdfa994ef28e14b836169ddc0d6208e46123b07a2 (diff)
downloadnextcloud-server-0f519f4856fce91ec77b65b913a9b305271fb883.tar.gz
nextcloud-server-0f519f4856fce91ec77b65b913a9b305271fb883.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);
- }
}