0.3.49
This commit is contained in:
@@ -132,7 +132,7 @@ func (s *Server) handleLogin(w http.ResponseWriter, r *http.Request) {
|
||||
Actor: req.Username, Target: req.DeviceName,
|
||||
Link: "/admin/logins",
|
||||
Metadata: adminevents.Meta(map[string]any{
|
||||
"deviceId": req.DeviceID, "ip": requestClientIP(r),
|
||||
"deviceId": req.DeviceID, "ip": s.resolveClientIP(r).String(),
|
||||
}),
|
||||
})
|
||||
writeError(w, http.StatusUnauthorized, "sign-in failed")
|
||||
@@ -205,14 +205,17 @@ func (s *Server) handleLogin(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Now that the session exists, the request line this call ends with can name it too.
|
||||
identify(r.Context(), sess)
|
||||
origin := s.resolveClientIP(r)
|
||||
s.loggerFor(r.Context()).Info("signed in",
|
||||
"emby_user", sess.EmbyUserID,
|
||||
"device_id", sess.DeviceID,
|
||||
"protocol", clientLogValue(sess.ClientProtocol),
|
||||
"replaced_session", len(created.ReplacedHash) > 0,
|
||||
"client_ip", origin.String(),
|
||||
"client_ip_via", origin.Via,
|
||||
)
|
||||
|
||||
address := requestClientIP(r)
|
||||
address := origin.String()
|
||||
s.recordLogin(r, store.LoginEvent{
|
||||
EmbyUserID: sess.EmbyUserID, Username: sess.Username,
|
||||
DeviceID: sess.DeviceID, DeviceName: sess.DeviceName,
|
||||
|
||||
Reference in New Issue
Block a user