contip
b1fa76e397
fix: keep apiKey encrypted in refresh operation ( #13063 ) ( #13177 )
...
### What?
Prevents decrypted apiKey from being saved back to database on the auth
refresh operation.
### Why?
References issue #13063 : refreshing a token for a logged-in user
decrypted `apiKey` and wrote it back in plaintext, corrupting the user
record.
### How?
The user is now fetched with `db.findOne` instead of `findByID`,
preserving the encryption of the key when saved back to the database
using `db.updateOne`. The user record is then re-fetched using
`findByID`, allowing for the decrypted key to be provided in the
response.
### Tests
* ✅ keeps apiKey encrypted in DB after refresh
* ✅ returns user with decrypted apiKey after refresh
Fixes #13063
2025-07-29 16:27:45 -04:00
..
2025-07-25 18:33:53 +00:00
2025-07-09 13:59:22 +00:00
2025-07-29 11:30:07 -04:00
2025-05-19 12:36:40 -03:00
2025-07-09 10:39:02 -04:00
2024-11-16 15:30:05 -05:00
2025-06-05 09:19:19 -07:00
2025-07-29 16:27:45 -04:00
2025-04-08 17:25:29 -03:00
2025-05-19 12:36:40 -03:00
2025-07-24 14:00:52 -04:00
2025-06-05 09:19:19 -07:00
2025-06-19 09:18:29 +00:00
2025-06-05 09:19:19 -07:00
2025-05-19 12:36:40 -03:00
2025-06-05 09:19:19 -07:00
2025-07-25 15:46:09 -07:00
2025-06-05 09:19:19 -07:00
2025-05-19 12:36:40 -03:00
2025-05-19 12:36:40 -03:00
2025-05-19 12:36:40 -03:00
2025-06-05 09:19:19 -07:00
2025-05-19 12:36:40 -03:00
2025-05-19 12:36:40 -03:00
2025-07-18 09:29:26 -04:00
2025-07-24 14:00:52 -04:00
2025-07-25 09:08:22 -04:00
2025-06-05 09:19:19 -07:00
2025-06-30 21:12:26 -04:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-05-19 12:36:40 -03:00
2025-07-29 11:55:02 -04:00
2025-07-29 11:49:15 -04:00
2025-06-11 06:23:22 -07:00
2025-07-12 07:03:26 -04:00
2024-10-30 17:56:50 +00:00
2025-07-29 11:49:15 -04:00
2025-07-25 22:58:49 +01:00
2025-05-19 12:36:40 -03:00
2025-07-29 11:49:15 -04:00
2024-08-13 12:54:33 -04:00
2025-07-24 20:37:13 +01:00
2025-05-19 12:36:40 -03:00
2025-07-24 14:00:52 -04:00
2025-06-05 09:19:19 -07:00
2025-05-19 12:36:40 -03:00
2025-05-19 12:36:40 -03:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-07-24 11:36:46 -04:00
2025-07-11 16:34:55 -04:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-06-05 09:19:19 -07:00
2025-07-24 14:00:52 -04:00
2025-07-18 06:48:27 -04:00
2025-07-25 09:10:21 -04:00
2024-07-23 13:44:44 -04:00
2025-07-23 16:48:25 -07:00
2025-06-27 09:13:52 -04:00
2025-07-29 03:25:09 +00:00
2025-07-10 08:00:26 -07:00
2025-07-10 08:00:26 -07:00
2025-07-10 08:00:26 -07:00
2025-07-10 08:00:26 -07:00
2025-07-10 08:00:26 -07:00
2025-07-28 11:29:04 -07:00
2025-06-29 14:20:54 -04:00
2025-07-29 16:21:50 -04:00
2025-07-29 11:49:15 -04:00
2024-07-11 15:59:38 -04:00
2025-06-04 17:34:37 -03:00
2025-06-05 22:01:55 -03:00
2024-12-31 09:14:56 -05:00
2025-07-18 09:29:26 -04:00
2025-07-16 15:17:43 -04:00
2025-07-16 15:17:43 -04:00
2024-08-13 12:54:33 -04:00
2025-03-05 19:14:35 +00:00
2024-09-16 17:02:08 +00:00
2025-07-24 14:00:52 -04:00
2025-07-18 06:48:27 -04:00
2024-11-11 13:59:05 -05:00
2024-10-11 18:54:39 +00:00
2025-02-17 19:50:32 +00:00
2024-10-11 18:54:39 +00:00
2024-12-17 14:49:29 -05:00
2025-07-11 16:34:55 -04:00
2025-07-28 16:23:43 +00:00
2025-02-07 03:24:49 +00:00
2025-06-05 22:01:55 -03:00
2025-07-18 06:48:27 -04:00
2024-08-14 08:57:04 -04:00
2024-10-14 20:02:26 +00:00
2025-03-05 19:14:35 +00:00
2025-05-12 09:41:18 -04:00
2025-02-14 00:08:20 +00:00
2025-01-14 20:00:00 -03:00
2025-03-05 19:14:35 +00:00