0.3.49
This commit is contained in:
@@ -31,7 +31,13 @@ func (s *Server) recordLogin(r *http.Request, event store.LoginEvent) {
|
||||
return
|
||||
}
|
||||
if event.IPAddress == "" {
|
||||
event.IPAddress = requestClientIP(r)
|
||||
origin := s.resolveClientIP(r)
|
||||
event.IPAddress = origin.String()
|
||||
// One line per sign-in attempt, so an operator can see which header the address
|
||||
// came from when a reverse proxy is in front of the gateway. Debug keeps it out
|
||||
// of the ordinary log while still being there when the question is asked.
|
||||
s.log.Debug("resolved login client ip",
|
||||
"ip", origin.String(), "via", origin.Via, "device_id", event.DeviceID)
|
||||
}
|
||||
if event.ClientVersion == "" {
|
||||
event.ClientVersion = clientVersion(r)
|
||||
|
||||
Reference in New Issue
Block a user