MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / saveLoginLogs

Function saveLoginLogs

core/app/api/v2/auth.go:513–525  ·  view source on GitHub ↗
(c *gin.Context, userName string, err error)

Source from the content-addressed store, hash-verified

511}
512
513func saveLoginLogs(c *gin.Context, userName string, err error) {
514 var logs model.LoginLog
515 if err != nil {
516 logs.Status = constant.StatusFailed
517 logs.Message = err.Error()
518 } else {
519 logs.Status = constant.StatusSuccess
520 }
521 logs.IP = c.ClientIP()
522 logs.User = userName
523 logs.Agent = c.GetHeader("User-Agent")
524 _ = logService.CreateLoginLog(logs)
525}
526
527func loginLogUserName(user *dto.UserLoginInfo, mfaSessionID string) string {
528 if user != nil {

Callers 3

LoginMethod · 0.85
MFALoginMethod · 0.85
PasskeyFinishLoginMethod · 0.85

Calls 2

CreateLoginLogMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected