mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-14 17:37:27 +00:00
fix: use user-agent for identifying known device signins
This commit is contained in:
@@ -73,7 +73,7 @@ func (s *AuditLogService) CreateNewSignInWithEmail(ctx context.Context, ipAddres
|
|||||||
stmt := tx.
|
stmt := tx.
|
||||||
WithContext(ctx).
|
WithContext(ctx).
|
||||||
Model(&model.AuditLog{}).
|
Model(&model.AuditLog{}).
|
||||||
Where("user_id = ? AND user_agent = ?", userID, ipAddress)
|
Where("user_id = ? AND user_agent = ?", userID, userAgent)
|
||||||
if ipAddress == "" {
|
if ipAddress == "" {
|
||||||
// An empty IP address is stored as NULL in the database
|
// An empty IP address is stored as NULL in the database
|
||||||
stmt = stmt.Where("ip_address IS NULL")
|
stmt = stmt.Where("ip_address IS NULL")
|
||||||
|
|||||||
Reference in New Issue
Block a user