Commit efdc2eb6 authored by ale's avatar ale

Fix logging of LoginMethod

parent e7dc7fdd
Pipeline #1415 passed with stages
in 1 minute and 23 seconds
......@@ -32,13 +32,21 @@ func (f *logFilter) Filter(user *User, req *auth.Request, resp *auth.Response) *
return resp
}
// TODO: Figuring this out from the request parameters isn't
// particularly smart.
method := usermetadb.LoginMethodPassword
if req.U2FResponse != nil {
method = usermetadb.LoginMethodU2F
} else if req.OTP != "" {
method = usermetadb.LoginMethodOTP
}
entry := usermetadb.LogEntry{
Timestamp: time.Now(),
Username: user.Name,
Type: usermetadb.LogTypeLogin,
Message: "successful login",
Service: req.Service,
LoginMethod: "web",
LoginMethod: method,
DeviceInfo: req.DeviceInfo,
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment