[Bug]: authtoken.ts does not throw or show error in addToken function
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
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
In apps/settings/src/store/authtoken.ts the addToken function does not throw an error to be used by apps/settings/src/components/AuthTokenSetup.vue the catch section of the code is basically deed code, as the function catches any error and returns null, which is not handled by AuthTokenSetup.vue, it tries to catch an error which is never thrown, and it does not show the error unlike the other functions in the authtoken.ts file.
Steps to reproduce
- Block the '/settings/personal/authtokens' endpoint in the browser, or disable it the server.
- Try to create a new device token, an error is never shown.
Expected behavior
Show an error for the user
Nextcloud Server version
35 (master)
Operating system
RHEL/CentOS
PHP engine version
PHP 8.5
Web server
Nginx
Database engine version
MariaDB
Is this bug present after an update or on a fresh install?
Fresh Nextcloud Server install
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
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
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with apps/settings/src/store/authtoken.ts and inspect the addToken error path, then compare how the other functions in that file report failures. Read apps/settings/src/components/AuthTokenSetup.vue to follow its catch handling and reproduce the issue by blocking the /settings/personal/authtokens endpoint. Done means token creation failures result in an error being shown to the user.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100