UniSharp / laravel-filemanager

Media gallery with CKEditor, TinyMCE and Summernote support. Built on Laravel file system.
https://unisharp.github.io/laravel-filemanager/
MIT License
2.08k stars 722 forks source link

Unable to upload when behind Basic Auth #1069

Open eronisko opened 3 years ago

eronisko commented 3 years ago

We're having trouble using the package in a set up where there is basic auth enabled on the server.

When basic auth is disabled, LFM works fine.

Steps to reproduce:

  1. Log into the app protected with basic auth on server (plus Laravel auth middleware)
  2. Open LFM pop-up via 'Browse server' button in our CKEditor integration
  3. Upload (any) file
  4. The pop-up upload window starts repeteadely asking for basic auth credentials, not accepting them image
  5. Clicking on "Cancel" produces a 401 Authorization Required error: image

Screenshots of browser console :

image

Note the error comes from our nginx server, not Laravel. I've also noticed that LFM sends a Authorization: Bearer null header with the upload request, which might be the source of trouble.

Could you point us in the right direction?

Jackson90 commented 1 year ago

I have exactly the same problem.

Operating system : CloudLinux v7.9.0 Laravel version : v7.30.6 Package version : v2.1

fixbew commented 2 months ago

After php artisan vendor:publish --tag=lfm_view Go to resources/views/vendor/laravel-filemanager/index.blade.php Remove prop: headers: { 'Authorization': 'Bearer ' + getUrlParam('token') },

Cause this code rewrite your browser basic auth