Description
Description:
We have identified an issue involving the .cryptkey
file that causes errors when switching accounts after using both SSO and Non-SSO login methods.
Steps to Reproduce:
-
Register a new account .
-
Log in with SSO and add an additional account via SSO. A
.cryptkey
file is created instorage/domain/user/.cryptkey
. -
Attempt to switch between the accounts — it works as expected.
-
Log out and log back in without using SSO.
-
Attempt to switch accounts again — an error occurs, and the following error is logged:
[2024-09-11 14:19:32.658][b4f90fd4] JSON[INFO]: {"Action":"AccountSwitch","Result":false,"ErrorCode":803,"ErrorMessage":"AccountSwitchFailed[803]","ErrorMessageAdditional":"CryptKeyError[111]","ExceptionCode":0,"epoch":1726064372}
[2024-09-11 14:19:32.694][b4f90fd4] [INFO]: Memory peak usage: 8MB
[2024-09-11 14:19:32.724][b4f90fd4] [INFO]: Time delta: 0.55190300941467
[2024-09-11 14:19:59.935][3e510555] [INFO]: [SM:2.37.2][IP:2401:4900:1c63:4335:c50:b8c2:84fe:e8f3][PID:1192][nginx/1.24.0][fpm-fcgi][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3][POST https://xxxxx.com/apps/snappymail/?/Json/&q[]=/0/]
[2024-09-11 14:19:59.975][3e510555] Nextcloud[DEBUG]: integrated
[2024-09-11 14:20:00.034][3e510555] JSON[INFO]: Action: DoAppDelayStart
[2024-09-11 14:20:00.069][3e510555] POST[INFO]: {"Action":"AppDelayStart"}
[2024-09-11 14:20:00.100][3e510555] COOKIE[DEBUG]: set smtoken
[2024-09-11 14:20:00.130][3e510555] JSON[INFO]: {"Action":"AppDelayStart","Result":true,"epoch":1726064400}
[2024-09-11 14:20:00.170][3e510555] [INFO]: Memory peak usage: 6MB
[2024-09-11 14:20:00.204][3e510555] [INFO]: Time delta: 0.43127679824829
### **Temporary Workaround:**
- Delete the `.cryptkey` file from `storage/domain/user/.cryptkey`.
- After deleting the `.cryptkey`, delete and re-add the account using Non-SSO login.
- Account switching then works correctly without error.
### **Issue Context:**
This issue seems to be related to the `.cryptkey` file behavior when transitioning between SSO and Non-SSO logins.
