Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add access_code feature #39

Merged
merged 12 commits into from
Mar 20, 2021
Merged

Add access_code feature #39

merged 12 commits into from
Mar 20, 2021

Conversation

rabol
Copy link
Contributor

@rabol rabol commented Mar 7, 2021

I have added a middleware entry in the config file

Simple test

$downloadAction = new DownloadFileAction('/Test.pdf');
$downloadAction->disk('public');
$magicLink = MagicLink::create($downloadAction);
$magicLink->forceFill(['access_code' => Hash::make('test')]);
$magicLink->update();
return view('empty')->with('link',$magicLink->url);

@cesargb cesargb linked an issue Mar 19, 2021 that may be closed by this pull request
@cesargb
Copy link
Owner

cesargb commented Mar 19, 2021

@rabol

Sorry for the delay. Your PR has good ideas and its functionality is a great improvement for this package.

I have added the tests and docs.

I have done a refactoring, mainly they are:

  • The access code is only requested if it has been established. Otherwise the code legacy is kept
  • Fusion two middleware in one
  • Rename the input name for access code to access_code

I think these changes can already be published in the new version. If you think any change is necessary, feel free to suggest it

Thanks!!

@rabol
Copy link
Contributor Author

rabol commented Mar 20, 2021

Hi

Happy to help - no need to change what you have added - my PR was just a quick solution.

@cesargb cesargb merged commit 14b14a6 into cesargb:master Mar 20, 2021
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.

Feature request: Ask for access code before download start
2 participants