fix: use user-agent for identifying known device signins

This commit is contained in:
Kyle Mendell
2025-07-20 19:02:17 -05:00
parent 4e49d3932a
commit ef1d599662

View File

@@ -73,7 +73,7 @@ func (s *AuditLogService) CreateNewSignInWithEmail(ctx context.Context, ipAddres
stmt := tx.
WithContext(ctx).
Model(&model.AuditLog{}).
Where("user_id = ? AND user_agent = ?", userID, ipAddress)
Where("user_id = ? AND user_agent = ?", userID, userAgent)
if ipAddress == "" {
// An empty IP address is stored as NULL in the database
stmt = stmt.Where("ip_address IS NULL")