Files
payloadcms/test
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-24 14:00:52 -04:00
2024-10-30 17:56:50 +00:00
2024-08-13 12:54:33 -04:00
2025-07-24 14:00:52 -04:00
2025-07-24 14:00:52 -04:00
2025-07-18 06:48:27 -04:00
2024-07-23 13:44:44 -04:00
2025-07-24 14:00:52 -04:00
2025-07-18 06:48:27 -04:00
2025-03-05 19:14:35 +00:00