Skip to content

feat(auth): add login anomaly detection#254

Open
gent33112-wq wants to merge 1 commit intorohitdash08:mainfrom
gent33112-wq:feature/login-anomaly-detection
Open

feat(auth): add login anomaly detection#254
gent33112-wq wants to merge 1 commit intorohitdash08:mainfrom
gent33112-wq:feature/login-anomaly-detection

Conversation

@gent33112-wq
Copy link

Summary

Detect unusual login behavior and alert users.

Changes

  1. User model - Added last_login_ip, last_login_at, last_login_user_agent fields
  2. Login route - Check for suspicious login (new IP, new device)
  3. Security alerts - Return security_alerts in login response when anomaly detected
  4. Schema - Updated schema.sql with new columns

How it works

  • On login, compare current IP and User-Agent with previous login
  • If different, add to security_alerts array
  • User can see alerts in login response

Acceptance Criteria:

  • ✅ Production ready implementation
  • ✅ Includes login tracking

/claim #124

- Add last_login_ip, last_login_at, last_login_user_agent fields to User model
- Check for suspicious login (new IP, new device)
- Return security_alerts in login response

/claim rohitdash08#124
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant