Refactor me.* procedures with code review fixes

- Fix silent failures: add 404 NOT_FOUND for invalid resources in
  passkeysRename, revokeSession, trustDevice, untrustDevice
- Fix race condition in passkeysDelete using transaction
- Extract helper functions: requireDeviceFingerprint, defaultDeviceName
- Improve type safety in updateProfile with Kysely's Updateable<Users>
- Extract me.* procedures to separate files under procedures/me/
- Standardize naming to verb-first: listPasskeys, renamePasskey, deletePasskey

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
RevIQ
2026-01-09 16:24:10 +08:00
parent 1ebcf12cb9
commit 9b898678c7
10 changed files with 555 additions and 125 deletions

View File

@@ -2248,12 +2248,12 @@ _Can run parallel to D_
_Depends on: D1 (auth middleware)_
- [ ] **F1**: Implement `me.get` and `me.setupProfile`
- [ ] **F2**: Implement `me.updateProfile`
- [ ] **F3**: Implement `me.setPassword`
- [x] **F2**: Implement `me.updateProfile`
- [x] **F3**: Implement `me.setPassword`
- [x] **F4**: Implement `me.listPasskeys`, `me.createPasskey`, `me.renamePasskey`, `me.deletePasskey`
- [ ] **F5**: Implement `me.listSessions`, `me.revokeSession`, `me.revokeAllSessions`
- [ ] **F6**: Implement `me.getDeviceInfo`, `me.trustDevice`, `me.listTrustedDevices`, `me.untrustDevice`, `me.revokeAllTrustedDevices`
- [ ] **F7**: Implement `me.delete` (account deletion)
- [x] **F5**: Implement `me.listSessions`, `me.revokeSession`, `me.revokeAllSessions`
- [x] **F6**: Implement `me.getDeviceInfo`, `me.trustDevice`, `me.listTrustedDevices`, `me.untrustDevice`, `me.revokeAllTrustedDevices`
- [x] **F7**: Implement `me.delete` (account deletion)
#### Workstream G: Email Service (Backend)