Skip to content

feat: device trust management & recognition#584

Open
mendarb wants to merge 1 commit intorohitdash08:mainfrom
mendarb:feat/device-trust-125
Open

feat: device trust management & recognition#584
mendarb wants to merge 1 commit intorohitdash08:mainfrom
mendarb:feat/device-trust-125

Conversation

@mendarb
Copy link

@mendarb mendarb commented Mar 20, 2026

Summary

  • Add DeviceFingerprint model (user_id, device_hash, device_name, ip_address, last_seen, trusted)
  • Generate SHA-256 device hash from user-agent + IP on each login
  • Add endpoints: GET /auth/devices, POST /auth/devices/trust, DELETE /auth/devices/:id
  • Record device automatically on login (non-blocking, exception-safe)
  • Add frontend Devices page with trust/remove buttons per device
  • Comprehensive backend tests covering login recording, trust, remove, deduplication

Closes #125

Test plan

  • Login creates a device fingerprint entry
  • GET /auth/devices returns list of devices for authenticated user
  • POST /auth/devices/trust marks a device as trusted
  • DELETE /auth/devices/:id removes a device
  • Repeated logins from same device update last_seen without creating duplicates
  • Endpoints reject unauthenticated requests with 401
  • Frontend page displays devices with trust/remove buttons

🤖 Generated with Claude Code

Add DeviceFingerprint model with SHA-256 hash from user-agent + IP.
Record device on login, with endpoints to list, trust, and remove
devices. Includes frontend device management page and backend tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mendarb mendarb requested a review from rohitdash08 as a code owner March 20, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Device trust management & recognition

1 participant