Skip to content

Fix error with single file download on protected shares#188

Open
benediktpenner wants to merge 1 commit intoErugoOSS:mainfrom
benediktpenner:main
Open

Fix error with single file download on protected shares#188
benediktpenner wants to merge 1 commit intoErugoOSS:mainfrom
benediktpenner:main

Conversation

@benediktpenner
Copy link
Copy Markdown

This changes are a possible fix for #187

I'm not a vue developer so it's AI generated and may be not perfect (but better than my code)

Copilot AI review requested due to automatic review settings January 22, 2026 15:54
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes issue #187 where single file downloads from password-protected shares failed with a "Password required" error even when the password was entered. The fix changes the single file download mechanism to use POST requests (when a password is provided) instead of GET redirects, allowing the password to be transmitted properly to the backend.

Changes:

  • Modified the API route for single file downloads to accept both GET and POST methods
  • Updated the downloader component to pass the password to child directory-item components
  • Enhanced the directory-item component to submit passwords via POST form when downloading files

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
routes/api.php Changed the downloadFile route from GET-only to accept any HTTP method (GET/POST), enabling password transmission for protected shares
resources/js/components/downloader.vue Added password prop to the directory-item component to enable password-protected downloads
resources/js/components/directory-item.vue Added password prop, implemented POST form submission for password-protected downloads, and propagated password to nested subdirectories

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

form.method = 'POST'

const passwordInput = document.createElement('input')
passwordInput.type = 'hidden'
Copy link

Copilot AI Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency with the existing pattern in downloader.vue (line 92), the password input type should be 'password' instead of 'hidden'. While both work for form submission, using 'password' maintains consistency across the codebase.

Suggested change
passwordInput.type = 'hidden'
passwordInput.type = 'password'

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could cause a flickering UI when downloading a file as the input is shown for some milliseconds.

@DeanWard
Copy link
Copy Markdown
Collaborator

Thank you for this fix. I will validate in merge it in the next few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants