jimmyl0l3c / cfg_share_links

App for Nextcloud that adds the ability to specify share tokens
GNU Affero General Public License v3.0
32 stars 3 forks source link

Custom share token are not deleted if the shared file is deleted #30

Closed Practicalbutterfly5 closed 2 years ago

Practicalbutterfly5 commented 2 years ago

Steps to reproduce: 1 Create a custom link 2 Delete the shared file 3 Try to create a new custom link with same custom token

Result: Unable to create link as it already exist

Expected: I should be allowed to create a new custom link with same custom token after the file was deleted.

jimmyl0l3c commented 2 years ago

Hi, thanks for reporting this issue.

I briefly tested it and found out that even the random generated tokens are not deleted when the file is deleted, which makes sense for the random tokens.

I'll look into it.

jimmyl0l3c commented 2 years ago

The issue is fixed in version 1.2.0.

When deleting file/folder that is shared with custom token, the custom shares are removed and the tokens can be used again. This works only with custom shares created/updated with version 1.2.0 (or later).

If you have custom tokens in database that were created using previous versions and cannot be used now, there is a new option to solve that. Navigate to Settings > Administration > Configurable Share Links and turn on the option: Delete shares of deleted files during token checks (when creating/updating share). Now if you try to create(/update) new custom share with token that was used for sharing deleted file/folder, the previous share will be deleted during token checks (when checking if the token is unique).