Open
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
After digging into this pull request, I found (and tested to be sure) that you can't update the token of a mail share.
TLDR: The bug is here
Steps to reproduce
Tip
Checkout the OCS Share API for more info (you'll see that it's out of date)
- Create a link share from the GUI or through the API (
POST <hostname>/ocs/v2.php/apps/files_sharing/api/v1/shares
) (shareType = 3
) - Update the token through the GUI or API (
PUT <hostname>/ocs/v2.php/apps/files_sharing/api/v1/shares/<shareID>
) - It works.
Now if we do the same with mail shares:
- Create a link share from the GUI or through the API (
POST <hostname>/ocs/v2.php/apps/files_sharing/api/v1/shares
) (shareType = 4
) - Update the token through the GUI or API (
PUT <hostname>/ocs/v2.php/apps/files_sharing/api/v1/shares/<shareID>
) - Now it's more subtle, because the server returns that the token have been updated:
<?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>200</statuscode>
<message>OK</message>
</meta>
<data>
<id>1</id>
<share_type>4</share_type>
...
<token>cust0mTok3n</token>
...
</data>
</ocs>
- But now just request data about the share through GUI or API (
GET <hostname>/ocs/v2.php/apps/files_sharing/api/v1/shares/<shareID>
), and you'll find out that the token is still the original one
Expected behavior
Sharing with mail should offer the ability to edit the token, just like how sharing with link works.
Everything is ready to do that, but in practice, the server does not care about the provided token
Nextcloud Server version
master
Operating system
None
PHP engine version
None
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
I haven't filled in the details of my installation because I provided you with the location of the bug in the 'master' branch (as of 11 June 2025), so I don't think it would be helpful to provide any more information.